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 http://www.steve.doig.com.au/wordpress/
.
The new site is http://www.superlogical.net
I tried using tried using the following .htaccess file in the /wordpress
directory:
RedirectMatch 301 http://www.steve.doig.com.au/wordpress(.*) http://www.superlogical.net/$1
However, all this does is redirect visitors to the URL: http://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?
RedirectMatch
directive matches against a root-relative (starting with a slash) URL-path, not the absolute URL, so the above directive would not have done anything - it would not have matched. Even it did match, it wouldn't have redirected to the/wordpress
folder - so there must have been something else going on here. Incidentally, 301 redirects are cached by the browser, so it's quite possible you were seeing a cached response. It's often best to first test with 302 (temporary) redirects for this reason.