How to jump a domain name to another domain name
This article will explain in detail how to jump to another domain name. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
The domain name jumps to another domain name, which can be achieved by 301 redirection. Different servers, different environments and languages, different methods, we briefly introduce two ways.
Many enterprises will apply for multiple domain names, such as com, cn, net, info, etc., in order to protect corporate brands. At this time, if you want each domain name to be automatically redirected to com when it is accessed, how can it be realized?
Domain name preparation: web1.com, web2.cn, web3.net, web4.info
1. Apache server
First resolve the domain name to the server IP:1.1.1.1
Then add to the http.conf:
# set .net to .comServerName web3.netServerAlias www.web3.netRedirectMatch Permanent ^ / (.*) http://web1.com/$1# set .cn to .comServerName web2.cnServerAlias www.web2.cnRedirectMatch Permanent ^ / (.*) http://web1.com/$1# set .info to .comServerName web4.infoServerAlias www.web4.infoRedirectMatch Permanent ^ / (.*) http://web1.com/$1ServerAdmin xxxx@web1.comServerName web1.comServerAlias www.web1.com
Then restart the Apache server
2. .htaccess mode
In the virtual host, there are Linux, Windows and other operating systems. Let's take the more common Linux as an example and use .htaccess files to achieve 301redirection:
RewriteEngine OnRewriteCond% {HTTP_HOST} ^ web2.cn [NC,OR] RewriteCond% {HTTP_HOST} ^ web3.net [NC,OR] RewriteCond% {HTTP_HOST} ^ web4.info [NC,OR] RewriteCond% {HTTP_HOST} ^ web1.com$ [NC] RewriteRule ^ (. *) $http://www.web1.com/$1
Here, whether it's cn, net, or info, it automatically jumps to web1, and web1.com automatically jumps to www.web1.com.
About how to jump to another domain name to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.