VPS侦探论坛

 找回密码
 注册
查看: 3808|回复: 3

301目录跳转怎么做

[复制链接]
发表于 2015-12-12 10:14:34 | 显示全部楼层 |阅读模式

找了下,貌似都是域名之间的跳转,http://www.xxx.com/gear-cutting
http://www.xxx.com/products

这种怎么做,找了好多试了下,貌似都不行!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-12 14:15:51 | 显示全部楼层


rewrite ^/gear-cutting http://www.xxx.com/products last;
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-12-12 18:05:21 | 显示全部楼层

回复 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;
}
是不是哪错了,为啥不生效呢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-12 19:34:35 | 显示全部楼层

回复 3# 的帖子




给你发的rewrite是让你直接原虚拟主机server断里就行了,不用再加什么location

所有nginx修改配置文件都需要重启或reload才能生效且配置文件没错才行
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 15:25 , Processed in 0.032223 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表