Forum Moderators: phranque
msg:4526235 [webmasterworld.com] mentioned the path part of the 3 URLs, but didn't clarify the requested hostname for the middle step.
rewriterule ^index\.php(/(.*))?$ http://www.example.com$1 [R=301,L] RewriteRule ^index\.php(/(.*))?$ http://www.example.com/$2 [R=301,L] rewriterule (.*) http://www.example.com/$2 [R=301,L] RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^some-old-url$ http://www.example.com.com/my-new-url [R=301,L] RewriteRule ^(.*/)?some-old-url$ http://www.example.com.com/my-new-url [R=301,L] RewriteRule ^(index.php\/)?some-old-url$ http://www.example.com.com/my-new-url [R=301,L]
I thought that the rewriterule above was supposed to capture any url ending in some-old-url
(.*) at the beginning of the pattern. The ^(.*) means read the entire URL all the way to the very end. Replace with ^(([^/]+/)*)index\.php to match and capture optional folder levels. RewriteRule ^thispage$ -- matches a request for example.com/thispage or www.example.com/thispage example.com/index.php/thispage you will need RewriteRule ^index\.php/thispage$ ^ means "begins with". It's good to include it, otherwise the rule might match other URL requests that it should not do so. AcceptPathInfo enabled or disabled on this site?