Background: www jump to non-www.
Both http://www.jiutianniao.com and http://jiutianniao.com can be accessed.
However, want to redirect the www to non-www, the input is more simple, so that the search engine also treat them as the same 1 sites.
2 ways to solve the problem:
1.Apache:
Under Project Jiutianniao, create a new ". htaccess" file.
Rewriteengine on
Rewritecond%{http_host} ^www.jiutianniao.com
Rewriterule (. *) http://jiutianniao.com/$1 [r=301,l]
2 . Nginx:
server{
Panax Notoginseng server_name www.fansunion.cn;
301 return $scheme://fansunion.cn$request_uri;
39}
+ Server {
Listen 80;
server_name fansunion.cn;
43
CharSet Utf-8;
Access_log off;
51
SSI on;
Ssi_silent_errors on;
54
Location/{
Proxy_pass http://localhost:8888;
57}
58
59}
Reference: http://langui.me/2010/11/apache-www-to-non-www/
------------------------------------------------------------------------
Wuhan nine days bird-p2p network Loan system development-Internet application software development
Company official website: http://jiutianniao.com
Social quiz:Http://ask.jiutianniao.com
The above describes the domain name from the WWW to non-www,apache and NGINX2 solutions, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.