mod_rewrite wont display front page

Vertigo

Verified User
Joined
Feb 24, 2008
Messages
8
Hi there,

Im creating a CMS using mod_rewrite with this htaccess...
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.php [QSA,L]
...which works fine for http://www.site.com/home, http://www.site.com/about, http://www.site.com/contact etc.... everything really, except when I point to http://www.site.com/ ... it returns a forbidden message. I have renamed the default index.html to xindex.html, naming it back brings up the index file. Its like the rules are being ignored for when the url is empty.

Any help would be appreciated.
 
I have gotten around it by removing the line...
RewriteCond %{REQUEST_FILENAME} !-d
...and adding forbidden lines for the include directories, but this isnt ideal, as I have no reason to disallow a user from creating their own page with the same name as one of my include directories (however unlikely that may be).

Is there a better way?

EDIT: This turns out to disallow access to all my include files actually, so not a solution at all. Help!
 
Last edited:
Back
Top