Forum Moderators: phranque

Message Too Old, No Replies

RewriteEngine produces 403 Forbidden

Apache RewriteEngine breaks perl produces 403 Forbidden messages

         

MJaggard

10:36 am on Feb 19, 2007 (gmt 0)

10+ Year Member



I have seen many similar problems but none have helped me to solve this.

To recreate (on my server at least):

1. Create a .htaccess file that mentions the Rewrite engine or rules. (even "RewriteEngine Off" is enough)

2. Create a perl file (maybe something like:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "hello";

3. Put them in the same directory on the webserver.

4. Go to the URL of the perl script and view the "403 Forbidden" error message.

5. Remove the lines mentioning the Rewrite engine or rules from the .htaccess file.

6. Go the the URL of the perl script again and see it working.

My webmaster is very helpful but won't change configuration of the main server without understanding exactly what he's doing, why it didn't work and why the change will fix it. This means that I can't just try several things and see what works - although I can change the .htaccess file as much as I like.
I've tried everything I can think of and that has been mentioned in
[webmasterworld.com...]
and
[webmasterworld.com...]

Thanks in advance,
Mat.

[edited by: MJaggard at 10:39 am (utc) on Feb. 19, 2007]

jdMorgan

2:20 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To use mod_rewrite, you must specify either

Options +FollowSymLinks
or
Options +SymLinksIfOwnerMatch

before attempting to enable the RewriteEngine, as described in the mod_rewrite documentation.

Jim

MJaggard

1:08 pm on Mar 1, 2007 (gmt 0)

10+ Year Member



I have already tried those two.

jdMorgan

2:31 pm on Mar 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The next step is to check the AllowOverride [httpd.apache.org] section of the server config. Verify that Options and FileInfo overrides are allowed, at a minimum.

When you get a server error, examine the server error log -- It's often quite helpful.

Jim