Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to do virtual host 301

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How does the virtual host do 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.

301 redirection, also known as 301 redirection, or 301 jump, refers to one of the status codes in the header information (header) in the HTTP data stream returned by the server when the user or search engine sends a browsing request to the web server, indicating that the page is permanently transferred to another address, thus ensuring that traffic can be transferred to the latest version of URL.

Here is how to set 301 manually:

Apache rule

In the host panel-File Management, enter wwwroot, create a new file, name it .htaccess file, write the following rules, and save it.

RewriteEngine On

RewriteCond% {HTTP_HOST} ^ xxxx1.com$ [NC]

RewriteCond% {HTTP_HOST} ^ xxxx2.com$ [NC]

RewriteRule ^ (. *) $http://www.xxxx1.com/$1 [Rust 301m L]

The effect is to jump to www.xxxx.com when xxxx.com accesses

RewriteCond is a condition. If you have multiple domain names, you can copy one more line.

Iis6 rule

In the host panel-basic functions of the website, click the isapi filter, click the second button "enable Custom url pseudo-static support", and then enter the

In others/discuz/httpd.conf, two strong lines are retained, the rest of the code is deleted, and the following code is copied to the file to save.

RewriteCond% {HTTP:Host} ^ xxxx1.com$ [NC]

RewriteCond% {HTTP:Host} ^ xxxx2.com$ [NC]

RewriteRule (. *) http://www.xxxx1.com$1 [NC,R=301]

The effect is to jump to www.xxxx1.com when accessing xxxx1.com and xxxx2.com

Iis7 rule

In the host panel-File Management, enter wwwroot, create a new file, name web.config, copy some rules, and save it.

The effect is to jump to www.xxxx1.com when accessing xxxx1.com and xxxx2.com

Among them, the virtual machine host has developed the "301" steering function, which can be quickly set, compared with manual setting, and the management is more simple and convenient.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report