You are not logged in.

#1 2008-02-22 19:22:53

Skittles
Member
From: Bochum (Ger)
Registered: 2007-07-21
Posts: 36

[Apache] Problem with Mod_rewrite

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

#2 2008-11-14 16:32:18

lateralus
Member
Registered: 2008-10-06
Posts: 29

Re: [Apache] Problem with Mod_rewrite

I'm having the same problem with mod_rewrite, but adding RewriteBase to .htaccess didn't change anything sad
phpinfo(); shows that Mod_Rewrite is loaded and active, but still it doesn't work.
.htaccess

RewriteEngine on
RewriteBase /
RewriteRule ^index.html$ foo

What's wrong? There is nothing in the logs.

Offline

#3 2009-08-14 20:20:32

wandrian
Member
Registered: 2009-03-01
Posts: 2

Re: [Apache] Problem with Mod_rewrite

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

#4 2010-03-25 14:10:29

Tamaz
Member
Registered: 2010-03-25
Posts: 3

Re: [Apache] Problem with Mod_rewrite

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

#5 2010-05-11 16:36:34

emk
Member
Registered: 2010-05-11
Posts: 33

Re: [Apache] Problem with Mod_rewrite

wandrian wrote:

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

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

#6 2010-08-21 11:27:57

EVRAMP
Member
From: Czech Republic
Registered: 2008-10-03
Posts: 173
Website

Re: [Apache] Problem with Mod_rewrite

Thank you very much!
I've added this information to wiki.

Offline

Board footer

Powered by FluxBB