301 Redirect Old Site Dynamic URLs To WordPress Permalinks
-
Hi,
Summary: Is there a way to use permalinks in .htaccess redirects instead of parameter-based URLs?
Details:
There is a post from a few weeks ago (see https://www.ads-software.com/support/topic/301-redirect-old-site-urls) which discussed redirecting from site A (old site) to site B (new WordPress powered site) using .htaccess 301 redirects. The solution was to redirect to the parameter-based URLs instead of their permalink URLs equivalents. While this solution works for me, I would like to know how to use the permalink structure, if only out of curiosity (not to mention the inconvenience of finding the ID # of every WordPress resource to redirect to).
In the aforementioned previous post a mooted solution was, e.g., ‘Redirect 301 /index.php?page=2 https://www.domain.co.uk/newpage/’. I’ve tried and failed using this method. Apache seems to completely ignore that line. Here is the .htaccess file used to test:
<IfModule mod_rewrite.c> RewriteEngine On Redirect 301 /index.php?page=mypage https://www.domain.co.uk/mypage/ RewriteBase /blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule>
In this case, the Redirect command is ignored and no redirect takes place.
And so, is there a way to use permalinks in redirects?
Thanks.
- The topic ‘301 Redirect Old Site Dynamic URLs To WordPress Permalinks’ is closed to new replies.