1
我想改写这个URL(是的,URL有一个问号):domain.com/blog/blogdetail?id=20
Nginx的重写与问号
这样:domain.com/train/my-page
这是我现在,但它不工作:
location /blog {
rewrite ^/blog/blogdetail(.*)id=20$ $scheme://$host/train/my-page permanent;
}
我不确定是怎么回事。我尝试过location /blog/
并在正则表达式中跳过/。
任何想法我失踪或另一种方式去做这件事?基本上,我有一堆具有特定ID#的页面,我需要重写它们各自的“基于字的”URL。
告诉你什么是你的预期产出。 – depsai 2014-10-29 04:51:12
Nginx仅重写uri的“路径”部分而无需查询。 – 2014-10-29 10:49:14
@depsai我的预期产出是问题的第一部分。 – shlant 2014-10-29 15:46:33