从服务器上下载下来的代码,部署到本地时,Url自动带www前缀

fix步骤:

1.网站根目录下,找到.htacess文件,有记事本打开

2.定位到

 RewriteCond %{HTTP_HOST} .
 RewriteCond %{HTTP_HOST} !^www. [NC]
 RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

把这三行注释掉就ok了

原文地址:https://www.cnblogs.com/barefoot/p/4884948.html