Sgt_Kickaxe - 1:29 pm on Dec 10, 2012 (gmt 0)
I fixed the typo, thanks g1smd, and I've tried the changes you mentioned Lucy but nothing changes. For simplicity I removed both the index.php/ and www arguments completely leaving ONLY the one line rewriterule and that rule fails. The problem is with that, somehow. e.g.
RewriteRule ^some-old-url$ http://www.example.com.com/my-new-url [R=301,L]
visiting www.example.com/index.php/some-old-url results in a 404 error.
visiting www.example.com/anything-here/some-old-url ALSO fails to redirect.
visiting www.example.com/some-old-url results in a 301 redirect to the right page.
I thought that the rewriterule above was supposed to capture any url ending in some-old-url but when there is a directory in the url it doesn't? So right now my site needs to redirect to remove the index.php/ first and then the first rule works so it immediately does that too.
RewriteRule ^index.php/some-old-url$ http://www.example.com.com/my-new-url [R=301,L]
works so which catchall should I use to consider the index.php/ without opening other cans of worms?
I ordered an .htaccess book for myself from Amazon btw - I'm not sure if that will be a present or punishment :)
edit: the following works but can it be improved?
RewriteRule ^(.*/)?some-old-url$ http://www.example.com.com/my-new-url [R=301,L]
would it be more efficient to use
RewriteRule ^(index.php\/)?some-old-url$ http://www.example.com.com/my-new-url [R=301,L]