: .htaccess RedirectMatch 301 issue I've moved my WordPress installation from one domain to another, and I want to use an .htaccess file on the original to redirect visitors to the new page on
I've moved my WordPress installation from one domain to another, and I want to use an .htaccess file on the original to redirect visitors to the new page on the new website.
The old site is www.steve.doig.com.au/wordpress/.
The new site is www.superlogical.net
I tried using tried using the following .htaccess file in the /wordpress directory:
RedirectMatch 301 www.steve.doig.com.au/wordpress(.*) www.superlogical.net/
However, all this does is redirect visitors to the URL: www.superlogical.net/wordpress/
I guess this is working properly, but I don't have Wordpress installed in a /wordpress folder on the new domain. How do I remove this from the URL redirected to?
More posts by @Samaraweera270
3 Comments
Sorted by latest first Latest Oldest Best
In the /wordpress/.htaccess file, I changed it to the following:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(.*)$ www.superlogical.net/ [R=301,L]
Which resolved it for me.
I've been told by my webhost to try the following:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?steve.doig.com.au/wordpress/$ [NC]
RewriteRule ^(.*)$ www.superlogical.net/ [R=301,L]
But this only works for the /wordpress folder, and not for any post or category page.
As you’re using regexp on the second parameter you want to escape the dots. Change
www.steve.doig.com.au/wordpress(.*)
to
www.steve.doig.com.au/wordpress(.*)
The logic itself, how you meant it, should work though. Passing the following URL-part to the new URL.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.