Page 1 of 1

Directory with same name as page alias

Posted: Wed Oct 25, 2006 4:08 pm
by Grantovich
On my site, if I create a page with the same alias as a directory on the server, going to the URL for that page will instead show a directory listing. I tried turning off the Indexes option, but now it only shows a "Not Found" error instead. I think it's to do with my rewrite rules: They make URLs look like http://mysite.com/page with no extension or anything. Can I retain this behavior and still have a directory with the same name as a page alias?

This is my htaccess file, it's slightly modified from the example given in the docs.

Code: Select all

Options -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [R,L]

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]