403 Error when turning on RewriteEngine

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

403 Error when turning on RewriteEngine

Post by mjseaden »

Dear All

Sorry to effectively duplicate my post from the PHP codes forum, I only just realised we had a specific Apache forum here, so here is my problem more concisely.

When I use phpinfo() on my web server (which is a shared hosting package), the mod_rewrite module is compiled into my server, as I made sure it would be before I opened a hosting account with the hosting company I use (which by the way has a crap support service!).

In my .htaccess file, I have the following basic config setup:

<IfModule mod_rewrite.c>
Options FollowSymlinks
RewriteEngine On
RewriteRule index* index.php
</IfModule>

This is done so that, instead of writing 'index.php' into the address bar of the browser, I can simply type 'index'. This is done mainly because I don't like extensions on scripts.

However, when I type in 'http://mydomain.com/index' into my browser address bar, I get the error

Code: Select all

Forbidden
You don't have permission to access /index.php on this server.

Apache/1.3.27 Server at mydomain.com Port 80
Therefore, it is successfully redirecting, but giving me a 403! This happens for all other scripts or files on the server, regardless of whether they have an associated Rewrite rule. This error disappears when I comment out the 'RewriteEngine On' line.

Can anyone help? I really need to get this sorted out!

Many thanks

Mark
Post Reply