Deployment prohibits Chinese browsers from accessing Web sites
in the htaccess file in the root directory of the Web site, add the following statement
############################################
# Enable rewrites
Options +followsymlinks
rewriteengine On
Rewritecond%{http:accept-language} ^zh-cn.*$ [Nc,or]
rewritecond%{http:accept-language} ^zh.*$ [NC]
rewriterule ^.*$ http://www.baidu.com [r=302,l]
Several examples of implementing 301 redirects
1. redirect sjolzy.cn to www.sjolzy.cn
This redirect is designed to make the domain name unique, is the website SEO must do, the back redirects www.sjolzy.cn to sjolzy.cn is also for the same reason, but the form is different.
Open the. htaccess file and add the following rules. (The following rule is for the primary domain name, and the subdomain is to be modified)
Rewriteengine on
rewritecond%{http_host}!^www.sjolzy.cn$ [NC]
rewriterule ^ (. *) $ http://www.sjolzy.cn/$1 [l,r=301]
2. redirect www.sjolzy.cn to sjolzy.cn
Rewriteengine on
rewritecond%{http_host}!^sjolzy.cn$ [NC]
rewriterule ^ (. *) $ http://sjolzy.cn/$1 [L,R=301]
3. REDIRECT oldsjolzy.cn to www.newsjolzy.cn
Rewriteengine on
rewritecond%{http_host}!oldsjolzy.cn$ [NC]
rewriterule ^ (. *) $ http://www.newsjolzy.cn/$1 [ L,R=301]
4. redirect oldsjolzy.cn to newsjolzy.cn
Rewriteengine on
rewritebase/
rewritecond%{http_host}!oldsjolzy.cn$ [NC]
rewriterule ^ (. *) $ http:// newsjolzy.cn/$1 [l,r=301]
5. redirect sjolzy.cn/file/file.php to othersjolzy.cn/otherfile/other.php
Rewritecond%{http_host} ^www.sjolzy.cn$
rewriterule ^file/file.php$ http://www.othersjolzy.cn/otherfile/ other.php [R=301,l]