You are not logged in.
Hi,
when I try to use mod_rewrite on my localhost, it won't run. Simple rules like ^index.html$ index.php [L] return me a 404-Error. I read somewhere in the forums about "AllowOverride" and set it to all, but i didn't improve anything. Does someone know how to fix that?
--- EDIT ---
Needed some RewriteBase
Last edited by Skittles (2008-02-23 18:01:38)
Offline
I'm having the same problem with mod_rewrite, but adding RewriteBase to .htaccess didn't change anything ![]()
phpinfo(); shows that Mod_Rewrite is loaded and active, but still it doesn't work.
.htaccess
RewriteEngine on
RewriteBase /
RewriteRule ^index.html$ fooWhat's wrong? There is nothing in the logs.
Offline
Just as reference for other people coming in this page. There is a solution setting correctly AllowOverride on the chosen directory in /etc/httpd/conf/httpd.conf
I found the solution in this thread:
http://bbs.archlinux.org/viewtopic.php?id=41606
Cheers
Offline
I allowed "AllowOverride" but my .htaccess is never read. To test this, I wrote bullshit into the htaccess file, but the Apache error_log didn't recognize an error. This is the setting for the directory:
AllowOverride FileInfo
Offline
Just as reference for other people coming in this page. There is a solution setting correctly AllowOverride on the chosen directory in /etc/httpd/conf/httpd.conf
I found the solution in this thread:
http://bbs.archlinux.org/viewtopic.php?id=41606Cheers
Also
Make sure you have the AllowOverride directive in in a directory container as follows:
<Directory /path/to/your/documentroot/>
...other stuff you might have in here ...
AllowOveride ALL
</Directory>
If the directive is not ALL then your .htaccess file may not be read: see:
http://httpd.apache.org/docs/2.1/mod/co … owoverride
P.S do not change the "AllowOverride None" directive in <Directory /> section of httpd.conf
If you still have problems you may wish to check that the AccessFileName directive (if present) in /etc/httpd/conf/httpd.conf reads:
AccessFileName .htaccess
see:
http://httpd.apache.org/docs/2.1/mod/co … ssfilename
I learnt this the hard way. Hope this helps others.
emk
Offline
Thank you very much!
I've added this information to wiki.
Offline