Forum Moderators: phranque
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9\ \-]+)$ $1/ [R=301]
RewriteRule ^([a-zA-Z0-9\ \-]+)/$ index.phtml?page=$1 [L]
RewriteRule ^([a-zA-Z0-9\ \-]+)/([a-zA-Z0-9\ \-]+)$ $1/$2/ [R=301]
RewriteRule ^([a-zA-Z0-9\ \-]+)/([a-zA-Z0-9\ \-]+)/$ index.phtml?page=$1&page2=$2 [L]
The RewriteRule sans forward-slashes at the end does not work, and instead, redirects to a home directory path when it should proceed to the rule that has the forward slashes implemented. An example of this not working would be:
[site.com...]
into:
[site.com...]
Any ideas?
[edited by: Furutsuzeru at 5:53 pm (utc) on Mar. 22, 2009]
Make sure that the most specific redirect is listed first in the block of redirects.
Make sure that the most specific rewrite is listed first in the block of rewrites.
The redirects should each include the full domain name in the target URL.
Be aware that a RewriteCond applies only to the single RewriteRule that follows it, so you might need to duplicate those.