Forum Moderators: phranque
The problem arises with "index", the home page. The CMS writes the home page content to /cms/index.php and /cms/index.txt and the .htaccess file second part rewrites a request for www.example.com/ to www.example.com/index where the content actually is (there is no index file in the root folder). This all seems to work fine too.
But I don't want www.example.com/index to be accessible in a browser, for obvious reasons. I've tried all manner of things but no success.
#
# Rewrite "string" everything to cms folder
RewriteRule ^([a-z0-9-]+)$ /cms/$1.php [L]
#
# Now Rewrite "/" to "/index" where the resource actually is
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .? http://www.example.com/index [L]
#
# Now Rewrite "index" to "/" - NEXT LINE DOESN'T WORK
RewriteRule ^index$ http://www.example.com/ [L]
#
The second two RewriteRules seem to be working against each other. Any assistance would be appreciated.
Patrick
#
# Rewrite "string" everything to /cms folder
RewriteCond %{REQUEST_URI} !^/index$
RewriteRule ^([a-z0-9-]+)$ /cms/$1.php [L]
#
# Rewrite "/" to "/cms/index.php"
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .? /cms/index.php [L]
#
Patrick
[edited by: Patrick_Taylor at 9:04 pm (utc) on Feb. 17, 2008]