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