-
为什么没有3x的nginx重写规则?
-
-
只找到2x的,但完全不适用于3x,改了一下,勉强可以了,但像weibo什么的还是不知道怎么弄
-
2452 次浏览
3 条评论
收藏
3个评论
-
-
--
2020-12-01 10:00
-
多谢分享。哈哈!!
补充上商业版的。location / {
rewrite ^/index.html$ /index.php last;
rewrite ^/home/([0-9]+)$ /index.php?c=home&uid=$1 last;
rewrite ^/wap$ /wap.php last;
rewrite ^/info/([0-9]+).html$ /index.php?c=info&a=detail&id=$1 last;
rewrite ^/party/([0-9]+).html$ /index.php?c=party&a=detail&id=$1 last;
rewrite ^/dating/([0-9]+).html$ /index.php?c=dating&a=detail&id=$1 last;
rewrite ^/ask/([0-9]+).html$ /index.php?c=ask&a=detail&id=$1 last;
rewrite ^/story/([0-9]+).html$ /index.php?c=story&a=detail&id=$1 last;
rewrite ^/weibo/([0-9]+).html$ /index.php?c=weibo&a=detail&id=$1 last;
rewrite ^/diary/([0-9]+).html$ /index.php?c=diary&a=detail&id=$1 last;
rewrite ^/ceshi/([0-9]+).html$ /index.php?c=ceshi&a=detail&id=$1 last;
}
-
-
回复 · 0条回复
-
-
-
--
楼主 2020-12-01 10:00
-
本帖最后由 goodfree 于 2013-4-12 11:13 编辑
Lee 发表于 2013-4-12 10:54 static/image/common/back.gif
试下以下规则是否可用
location / {
rewrite ^(.*)([a-z]+)/([0-9]+)\\.html$ $1/index.php?c=$2&a=detail& ...
自己参考其他规则改了一下,目前测试正常
rewrite ^/index.html$ /index.php last;
rewrite ^/home/([0-9]+)$ /index.php?c=home&uid=$1 last;
rewrite ^/wap$ /wap.php last;
rewrite ^/info/([0-9]+).html$ /index.php?c=info&a=detail&id=$1 last;
rewrite ^/weibo/([0-9]+).html$ /index.php?c=weibo&a=detail&id=$1 last;
rewrite ^/diary/([0-9]+).html$ /index.php?c=diary&a=detail&id=$1 last;
-
-
回复 · 0条回复
-
-
-
Lee
官方认证帐号 2020-12-01 10:00
-
试下以下规则是否可用
location / {
rewrite ^(.*)([a-z]+)/([0-9]+)\\.html$ $1/index.php?c=$2&a=detail&id=$3 last;
rewrite ^(.*)home/([0-9]+)$ $1/index.php?c=home&uid=$2 last;
rewrite ^(.*)wap$ $1/wap.php last;
}
-
-
回复 · 0条回复
-
作者信息
-
关注
-
试
免费试用
-
咨询热线
-
咨询热线
020-82299 259
-
在线咨询