您的位置:首页 > 运维架构 > Nginx

nginx 伪静态的设置

2016-02-25 14:21 561 查看
以下操作实现当用户访问 www.tetuhao.com/link.html 时,显示的是www.tetuhao.com/shop/index.php?act=link 的内容。同时网址显示的仍是www.tetuhao.com/link.html

一:vim /usr/local/nginx/conf/nginx.conf
在server块中加入以下内容
location / {
rewrite ^(.*)/link\.html$ $1/shop/index.php?act=link last;
}

二:检查配置文件 /etc/init.d/nginx configtest
三:重新加载nginx /etc/init.d/nginx reload

本文出自 “夜读才子盼女鬼” 博客,请务必保留此出处http://more3.blog.51cto.com/9929586/1744985
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: