I have 2 domains one main, one parked. I recently switched but host provider told me theyd repoint the DNS but there are problems? Do it via DS

I have 2 domains one main, one parked. I recently switched but host provider told me theyd repoint the DNS but there are problems? Do it via DS - .htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, , , .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :


I wanted to switch my site from www.mutantspace.ie to www.mutantspace.com. Up until now the .com was my parked domain. I looked into it and was told that using this code in my .htaccess file in www.mutantspace.ie would work:



RewriteEngine on
RewriteCond %http_host !^www.mutantspace.ie$ [nc]
RewriteRule ^(.*)$ http://www.mutantspace.com/$1 [r=301,nc,L]


I then asked my provider and he said 'Where are you moving too though?' Then he told me best way was for them to repoint site to www.mutantspace.com.
I said fine (in my ignorance) and that is whats happened.



However even though new URLs are being indexed I have 100s of old URLs out there returning 404s. Now I can't access my old .htaccess file to put in permanent redirects because its now .com. Is there any code that I can use anywhere in my root directory that will redirect old www.mutantspace.ie pages to their corresponding www.mutantspace.com/ pages?


Solution :

If you had one hosting account for the .ie domain, then simply pointing the .com to the same hosting would be the simplest, to avoid having to move/upload files. Then set the .ie domain to redirect to the .com.



It sounds like your host did the first part, but have ignored the .ie domain. Depending on where the domain is held, you should be able to set up a redirect to the .com. Some domain providers do this well, redirecting the domain and all sub pages with a 301 redirect. Other providers only redirect the root domain, or redirect all requests from one domain to a single domain (i.e. a URL like example.ie/page goes to example.com - this is not what you want).



Alternatively, point both domains to the same hosting and use the .htaccess as above to do the redirecting.


Additionally, if you would like to do some further testing, give the htaccess tester tool a try. It allows you to specify a certain URL as well as the rules you would like to include and then shows which rules were tested, which ones met the criteria, and which ones were executed.

Comments

Popular posts from this blog

Rewrite in Mediawiki, remove index.php, .htaccess

.htaccess rewrite wildcard folder paths from host

Using .htaccess to set a cookie and 301 redirect