NameCheap 301 Url Redirect Doesn’t Support Url to Url Mapping
As I have told you I just sifted my blog to the new domain waveofweb.com. So I was looking for a way to map each url of my old domain to the new one. Obviously there is a way to do it in .htaccess file. And like most of the hosting companies my host DreamHost does support Apache mod-rewrite to use .htaccess. But I heard that Namecheap provides 301 redirect if you transfer DNS to them. And you can do it in UI with just a few clicks and without modifying any code by hand. So I used to it. But that 301 redirect will only redirect any url of the old domain to the new domain’s home page. So all my blog post urls or About page or any any other url of the old domain were getting redirected to the blog home page. I contacted their support in live chat. But they were unable to provide any solution.
So I transferred back my old domain to my hosting company NameServer. I modified the code in .htaccess file. And url to url mapping from old domain to the new one started working perfectly
Related posts:
It’d be helpful if you included the .htaccess code you used.
@Hans Mast
Yeah, I should have added that code
So if you find .htaccess file in your old domain empty, just add the below code
But in case of your WordPress blog, you will most probably find the below two lines in your .htaccess file
In that case just add the following line right after the above two lines and before any other rewrite rules
Remember to change “newdomain.com” with your new domain name. And whether you want to use “www” or not, that’s your choice. This is enough for url to url mapping using 301 redirect.