Mobile app version of vmapp.org
Login or Join
Ogunnowo487

: Moving website on same IP from one domain TLD to another different using 301 redirect If we want to move a website from one TLD to another, e.g example.com to example.org, while preserving

@Ogunnowo487

Posted in: #301Redirect #Apache #Domains #GoogleSearchConsole #TopLevelDomains

If we want to move a website from one TLD to another, e.g example.com to example.org, while preserving SEO.

We intend to do the following:


Point both example.com and example.org to same IP where my site is working.
Use canonical URL to have example.org/* instead of example.com/*
Use 301 redirect from old TLD to new.
Add site to Google Webmaster Tools and make a change request.


But the big problem is we are unable to 301 redirect from example.com to example.org as both are on same IP, doing so is causing redirect loop and error.

How can I prevent the redirect looping?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Ogunnowo487

2 Comments

Sorted by latest first Latest Oldest Best

 

@Lee4591628

You should redirect all requests to example.com to example.org. This works best with Apache web server:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) example.org/ [R=301,L]


I haven't tested it now, but it should work. Maybe you should do a rewrite from example.org to example.org with status code 301, and the same for example.com, but I'm not sure.

10% popularity Vote Up Vote Down


 

@Barnes591

You can use .htaccess file for redirecting requests that come to example.com to example.org. Ensure that this rewrite rule gets fired only when the request comes to example.com; that way after the first redirect you will not get stuck in an infinite loop. You can test .htaccess redirects using various online htaccess web applications.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme