我有兩個sudomainsnginx的重寫隱藏用戶
www.test.com
wiki.test.com
由於維基多語言域名,我有幾個子目錄
http://wiki.test.com/en for English
http://wiki.test.com/es for Spanish
等
到現在爲止,在根目錄wiki.test.com是一個簡單的頁面,詢問您想要哪種語言並重定向到語言子目錄。
但現在,我想該
http://wiki.test.com
負載 「選擇語言頁」:
http://www.test.com/index.php?page=wiki
(只有 「wiki.test.com」 或「wiki.test .COM /」,而不是像一個子目錄 「wiki.test.com/ru」)
所以我想到了
server {
server_name wiki.test.com;
...
index index.php;
location =/{
rewrite^http://www.test.com/index.php?page=wiki;
#OR return 302 http://www.test.com/index.php?page=wiki;
}
location/{
try_files $uri $uri/ /index.php?q=$uri&$args;
}
[...]
}
但問題是,當我打開wiki.test.com,人們可以看到rewrited網址www.test.com/index.php?page=wiki而我想他們只看到維基。 test.com。
我敢肯定,這個解決方案非常簡單,我做了一個相當廣泛的搜索,但我不能使用好的關鍵字來尋找解決方案(我發現了很多與proxy_pass有關的類似問題,但我有沒有印象proxy_pass是我的情況的解決方案)
感謝很多提前:)