301目录跳转怎么做
找了下,貌似都是域名之间的跳转,http://www.xxx.com/gear-cuttinghttp://www.xxx.com/products
这种怎么做,找了好多试了下,貌似都不行! rewrite ^/gear-cutting http://www.xxx.com/products last;
回复 2# 的帖子
location ~ .*.(php|php5)?$ {#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;
}
}
location /gear-cutting/ {
rewrite ^/gear-cutting http://www.gears-drives.com/products last;
}
server {
server_name gears-drives.com;
rewrite ^/gear-cutting http://www.gears-drives.com/products last;
}
是不是哪错了,为啥不生效呢
回复 3# 的帖子
给你发的rewrite是让你直接原虚拟主机server断里就行了,不用再加什么location所有nginx修改配置文件都需要重启或reload才能生效且配置文件没错才行
页:
[1]