In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to redirect the virtual host 301, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
The easiest way to redirect a virtual host is to set it directly according to the 301 function of the cloud service operator's management system.
Virtual hosts generally have matching management systems, which provide simple functions such as host domain name binding, 301 setting, 404 setting, pseudo-static setting and so on. For example, virtual host management has several modules, such as website basic function, website file management, website security management, website intelligence system, host related service management and so on. Among them, the basic functions of the website are as follows: host domain name binding, password modification, home page setting, host status setting, php version, pseudo-static setting, host diagnosis, 301 redirection, custom 404 and so on.
Let's use the Linux virtual host to explain in detail how to redirect the virtual host. First check whether there is a .htaccess file in the root directory of the virtual host, and if so, change the code directly on this file:
RewriteEngine OnRewriteCond% {HTTP_HOST} ^ xxxx1.com$ [NC] RewriteCond% {HTTP_HOST} ^ xxxx2.com$ [NC] RewriteRule ^ (. *) $http://www.xxxx1.com/$1
Note: the above rule is to redirect all the accessed domain names of the site xxxx1 to the new domain name xxxx2.com (please modify the domain name in the rule to your own domain name). At the same time, both xxx1 and xxx2 revenue addresses will be redirected to www.xxx2.com.
What if you need to change the address of http page 301 to https?
RewriteCond% {HTTP:From-Https}! ^ on$ [NC] RewriteCond% {HTTP_HOST} ^ (www.)? xxx2.com$ [NC] RewriteRule ^ (. *) $https://www.xxx2.com/$1 [Rene301 Magi L]
According to the above rules, you can redirect the http status of all pages to https.
If there is no .htaccess file in the root directory, create a new text document, copy the above code into the document, save it as .htaccess, and then upload the file to the root directory. You can achieve 301 redirection.
The above content is how to redirect the virtual host 301. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.