有些用户在安装站点的时候,使用了www.abc.com的域名,然后再访问网站的时候,直接abc.com访问,就会出现JS等资源文件跨域的报错提示,这种情况可以通过修改伪静态规则解决,以下是Nginx下的修改方法,其他web服务器参照修改(红字为修改部分,域名请修改为自己的安装时填写的域名): location / { if ( $host != 'test.shopwind.net' ){ rewrite ^(.*)$ http://test.shopwind.net$1 permanent; } #Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php$is_args$args; }