Page is a not externally linkable
Sgt_Kickaxe - 5:59 am on Dec 9, 2012 (gmt 0)
To clarify, the following works for visitors but it creates a double 301 redirect for the RedirectMatch if www is not present or /index.php/ is present in the request url(on wordpress sites).
# redirected url
RedirectMatch Permanent ^/some-old-url$ http://www.example.com/the-new-url
# remove index.php from urls
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(/[^\ ]*)?\ HTTP/
RewriteRule ^index\.php(/(.*))?$ http://www.example.com/$1 [R=301,L]
# add www if it's missing
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
# wordpress basic
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
In spending the past hour searching the net I've found that this is a problem other wordpress sites have too and the owners may not even be aware of it. I haven't found a solution yet.
From: /index.php/some-old-url
To: /some-old-url <----- why is this 301 happening with the above?
To: /the-new-url