CVM: how to set 301 for CVM
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]