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--
How to redirect virtual host 301? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
The virtual host 301 is redirected, which is divided into Linux virtual host and Windows virtual host. 301 is configured differently for different operating systems.
301 redirection is a very important "automatic steering" technology. For example, when we visit west.cn, we see https://www.west.cn/; when we visit www.west.cn, we also visit the https://www.west.cn/ page. This is to do 301 redirection, unify different domain name forms into one URL, can achieve URL standardization, and leave a good impression on users and search engines.
1. How to redirect the virtual host 301 of Linux system
Linux virtual host, general pseudo-static rules are put into .htaccess file:
RewriteEngine OnRewriteCond% {HTTP:From-Https}! ^ on$ [NC] RewriteCond% {HTTP_HOST} ^ (www.)? xxx.com$ [NC] RewriteRule ^ (. *) $https://www.xxx.com/$1 [Rene301 Magi L]
# Jump xxx.com and www.xxx.com to https://www.xxx.com, to prevent the apache substation from inheriting the parent directory. .htaccess is affected. Delete the comments by yourself and do not need to put the htaccess file.
2. How to redirect the virtual host 301 of Windows system
Windows virtual host, generally pseudo-static rules are put into the web.config file.
# www.xxx.com should be modified to your own domain name. Delete the comments by yourself and do not need to put them in the web.config file.
Of course, in addition to the above configuration file, we can also use code directly:
Windows virtual host, ASP language:
Response.Status= "301 Moved Permanently" Response.AddHeader "Location", "https://www.xxx.com"Response.End"
Linux virtual host, PHP language:
Header ("HTTP/1.1 301 Moved Permanently"); header ("Location: https://www.xxx.com");exit();"
Description: just add the code to the relevant page. It is usually put in the header file.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.