建立主机时绑定了XXXX.com,然后让www.XXXX.com跳转到XXXX.com,应用了typecho的rewrite规则。
现在出现个问题,用www.XXXX.com访问时,跳转到XXXX.com//index.php,多了个/,404了。。。
如何修改可以解决?配置文件如下:
#zxcv.com.conf
现在出现个问题,用www.XXXX.com访问时,跳转到XXXX.com//index.php,多了个/,404了。。。
如何修改可以解决?配置文件如下:
#zxcv.com.conf
server {
listen 80;
server_name zxcv.com www.zxcv.com;
access_log off;
index index.html index.htm index.php;
include /usr/local/nginx/conf/typecho.conf;
root /data/wwwroot/zxcv.com;
if ($host != zxcv.com) {
rewrite ^/(.*)$ $scheme://zxcv.com/$1 permanent;
}
location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv)$ {
valid_referers none blocked *.zxcv.com zxcv.com www.zxcv.com;
if ($invalid_referer) {
#rewrite ^/ http://www.linuxeye.com/403.html;
return 403;
}
}
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
}
#typecho.conf
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-e $request_filename){
rewrite (.*) /index.php;
}
不会写配置文件,求解答。。。感谢