Directory with same name as page alias

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Grantovich

Directory with same name as page alias

Post 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]
Locked

Return to “CMSMS Core”