There is a domain ohhioshop.com and there is a domain Ohhio.me. Both on different servers, one for the second test work. You need ohhioshop.com to switch to Ohhio.me. Both domains are registered on the same server. It's easy to replace un, I can't redirect to Ohhio. me, the service is writing an error.

  • And what is used as a web server? If speech, of course, about a site - Gedweb
  • Apache web server. - Dima Balovnev
  • If one of the answers came up for you, please mark it as correct - Insider

2 answers 2

You can use different redirection methods:

HTML

<meta http-equiv="refresh" content="0; URL='http://new-website.com'" /> 

Javascript

 window.location = "http://new-website.com"; 

However, JavaScript is very strange and there are many ways to do this:

 window.location = "http://new-website.com"; window.location.href = "http://new-website.com"; window.location.assign("http://new-website.com"); window.location.replace("http://new-website.com"); 

Apache

 Redirect 301 / http://www.new-website.com 

.htaccess

 RewriteEngine On RewriteBase / RewriteRule ^(.*)$ http://www.new-website.com [L,R=permanent] 

Either do all the redirect on your hosting.

  • then dev.ohhioshop.com redirect on Ohhio.me and it is not necessary. - Dima Balovnev
  • @ DimaBalovnev, then I do not understand your question. Try to rephrase it. Fill in all the information, etc. - Insider
  • Two servers, and two domains ohhioshop.com Ohhio.me. there is also a subdomain, dev.ohhioshop.com, how to redirect just one domain, namely ohhioshop.com, did not affect the Dev domain. - Dima Balovnev
  • @ DimaBalovnev The first version with HTML, will not touch the devs - Insider
  • Thanks, I will try. - Dima Balovnev

If both domains lead to the same apache web server, simply add an alias for the host.

 <VirtualHost *:80> ServerName ohhio.me ServerAlias ohhioshop.com ... # Other directives here </VirtualHost> 

NOTE

Apparently, this is not about servers, but about virtual hosts, since ip domains are the same.