关于LNMPA网页状态
网址:www.bilpage.com bilpage.com 现在的状态是:www的跳转到不带WWW上面,状态301。不带www,状态200。这个www的是不是不正常?我想要两个都是200要怎么弄?apache的VHOST:
文件名:www.bilpage.com.conf
内容:
<VirtualHost *:88>
ServerAdmin webmaster@example.com
php_admin_value open_basedir "/home/wwwroot/wp:/tmp/:/var/tmp/:/proc/"
DocumentRoot "/home/wwwroot/wp"
ServerName www.bilpage.com
ServerAlias bilpage.com
</VirtualHost>
nginx的VHOST:
文件名:www.bilpage.com.conf
内容:
log_formatwww.bilpage.com.log'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80;
server_name www.bilpage.com bilpage.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/wp;
location / {
try_files $uri @apache;
}
location @apache {
internal;
proxy_pass http://127.0.0.1:88;
include proxy.conf;
}
location ~ .*\.(php|php5)?$
{
proxy_pass http://127.0.0.1:88;
include proxy.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_logoff;
}
[ 本帖最后由 ilmin 于 2013-9-1 23:51 编辑 ] 前面帖子我已经说过了,除非设置了301或程序上加了301
配置上没问题,基本上就是程序的问题。
看你程序上是wp,你在wp设置的是不带www为主域名,所有访问带www的域名会先有301了
root@vpser:~# curl -IL bilpage.com
HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Mon, 02 Sep 2013 02:00:34 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.2.17p1
X-Pingback: http://bilpage.com/xmlrpc.php
root@vpser:~# curl -IL www.bilpage.com
HTTP/1.1 301 Moved Permanently
Server: nginx/1.2.7
Date: Mon, 02 Sep 2013 02:00:40 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/5.2.17p1
X-Pingback: http://bilpage.com/xmlrpc.php
Location: http://bilpage.com/
HTTP/1.1 200 OK
Server: nginx/1.2.7
Date: Mon, 02 Sep 2013 02:00:41 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.2.17p1
X-Pingback: http://bilpage.com/xmlrpc.php 谢谢军哥
页:
[1]