Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Issues running CMS in subfolder


lucy24 - 5:27 am on Jan 29, 2013 (gmt 0)


# Redirect GET /cms/string.php HTTP/1.1 to /string (the link)
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /cms/([A-Za-z0-9_-]+)\.php\ HTTP/
RewriteRule ^cms/([A-Za-z0-9_-]+)\.php$ /$1 [R=301,L]

RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^$ /cms/index.php [L]

RewriteCond %{REQUEST_URI} !^/index$
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([A-Za-z0-9_-]+)\ HTTP/
RewriteRule ^([A-Za-z0-9_-]+)$ /cms/$1.php [L]


I'm getting lost again. What happens to (1) requests for index.php by name (2) correctly worded requests for / (any directory) (3) requests for /laplume/ without the /cms/ component?

I think maybe you need to step back again. Forget RewriteRules and simply list all the forms of URL that a human could possibly ask for. For each form, what do you want their address bar to say?

Take the time to think of all possible permutations:
with and without /laplume/
with and without /cms/
with and without extension, both for index pages and others
with and without "index.xtn"
et cetera.

And then-- entirely separate-- within the smaller group of Authorized Requests that are left when all the redirects are done, where does the content really live?


Thread source:: http://www.webmasterworld.com/apache/4533901.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com