Usually, it is fairly straightforward to use a .htaccess file to redirect an old website to a new one. Yet for some reason, I was having the hardest time getting this to work for my wife’s old blog. There was a link that came up when you Googled her name, and I was using that link to test the redirection.
The problem was that it would not only redirect to the new domain, but include the full URL. And since her old blog used a different folder structure, people who clicked this link would receive a 404 error.
The specific issue was there was a question mark in the URL, which made the URL into a query string, which is handled differently than normal forwarding requests in an .htaccess file. The solution?
Put a question mark at the end of the RewriteRule. So in this specific case, the file now looks like:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*leanneheller\.com$ [NC]
RewriteRule ^(.*)$ http://www.guidetoworlddomination.com? [R=301,L]
Adding that question mark to the end seems to overwrite any previous query string requests, and will send any requests from the old domain to the root of the new one.





Your wife thanks you!
Thanks for this tutorial. I had been wondering how to do that until i read this.
htaccess redirect is the most SEO friendly way to redirect URLs. However, most people tend to forget that it’s also the most user friendly method. This allows instant redirects since the web server reads the htaccess file before showing the web page. This prevents you from losing visitors due to long web page loading times. Great Article!