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

CVM: how to set 301 for CVM

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

Share

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

How to set 301 for CVM? The so-called 301 redirection is a permanent redirection. When establishing a website on a CVM, you need to standardize and centralize the primary domain name to prevent decentralization, so you need to redirect the website to 301.

The general steps for setting 301 redirection on a server are as follows:

1. Resolve all domain names with "www" and those without "www" and bind them to the leased CVM.

2. Linux host 301 redirect setting method

Create a new text document on your computer, then change the suffix to .htAccess, add the following code to save it (remember to change abc to your own domain name), and upload it to the root directory of the website with FTP software!

RewriteEngine onRewriteCond% {http_host} ^ abc.com [NC] RewriteRule ^ (. *) $http://www.abc.com/$1 [Lmaine Renew301]

3. Windows host 301 redirect setting method

Create a new text document on your computer, then rename it httpd.ini, open it and add the following code to save it (remember to change abc to your own domain name)

RewriteCond Host: ^ ABC\ .com $RewriteRule (. *) http\: / / www\ .ABC\ .com / $1 [RMagi]

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