Using .htaccess in XAMPP on Windows
I googled quiet some time on using custom links for your site on windows using XAMPP. All of them suggested me to uncomment line for ‘mod_rewrite’, set AllowOverride to All. I tried this but it still faced same issue, a 404 error page.
Then I came to one more solution that I tried an bingooo!, it worked like charm. Just to keep note and save some time of other developers , I am putting all steps here . First 2, 3 steps are commonly suggested.
- Open your apache conf file “httpd.conf” in any editor of your choice.
- Search “mod_rewrite.so”, you may encounter line as follows –
#LoadModule rewrite_module modules/mod_rewrite.so
- Remove the comment “#”.
- Find “AccessFileName” , you may see a line like –
“AccessFileName ht.acl” change it to “AccessFileName htaccess.txt”.
- Create “htaccess.txt” in sites root directory.
- Restart apache
Thats it, you are done!
5 Comments
hellow please give me a suggest to my problem
when i create a .htaccess file on localserver that file received but not work
my htaccess code———–
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)$profile.php?u=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$profile.php?u=$1
@Niklas
Find lines below in your conf file and remove the # before.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
And also do the changes, what mentioned in this post.
not working ur suggest
Find “AccessFileName” , you may see a line like –
“AccessFileName ht.acl” change it to “AccessFileName htaccess.txt”.
There is no such text in my conf file…
Niklas
Here is my conf file –
#
# AccessFileName: The name of the file to look for in each directory
# for access control information. See also the AllowOverride directive.
#
# AccessFileName .htaccess
#AccessFileName ht.acl
AccessFileName htaccess.txt