我希望输入http://www.myweb.com/like/1234456的人将重定向到http://www.myweb.com/item.php?itemid=1234456
我在配置中写了一些类似这样的东西,但它不起作用。
location = ^~/like/ {
rewrite ^1234456 ../likeitem.php?item=1234456break;
return 403;
}
这只是一个测试。我还没有使用$ matching。
我也重新启动了我的ngnix服务器,但仍然..它不做重定向。
发布于 2015-10-02 16:17:17
尝尝这个,
server {
server_name www.myweb.com;
rewrite ^/like/(.*) http://www.myweb.com/item.php?itemid=$1 permanent;
}
https://stackoverflow.com/questions/4329316
复制相似问题