如何防止www网址自动跳转到非www的网址
我用的是LNMP安装包域名服务商是godaddy,设置中A name为@和www,分别指向VPS的ip
server block为下面:
server
{
listen 80;
#listen [::]:80;
server_name xxxx www.xxxx;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/www.solittt.me;
include wordpress.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log/home/wwwlogs/www.xxxx.logaccess;
}
浏览器输入www的网址会被跳转到非www得网址,请问问题出在哪里呢?我在哪里可以把设置改回来呢?
我想要的效果是www和非www的指向的ip是一样的,但是浏览器显示的地址一个带www另外一个不带
[ 本帖最后由 ToddCool 于 2016-6-8 23:33 编辑 ] 如果是wordpress之类的程序,如果你用非www域名安装的,当访问www域名时会301到非www
你可以换成一个静态页面试试看
回复 2# 的帖子
那怎么设置成Wordpress可以接受www和非www站点 并且不进行跳转呢?回复 3# 的帖子
wordpress就是这样,好像是没法弄,可能只有修改程序或换其他程序了
页:
[1]