我有這樣一個問題,我無法解決。我有一個nginx服務器,我必須做一個這種型別的重定向。
http://midomain.com/xxxx/xxxx/ http://wikipedia.com/xx --> http://midomain.com/yyyy
由于我有兩個帶空格的尿液,所以沒有辦法使其發揮作用。
我已經嘗試了多種方法。
我已經嘗試了多種方法。
rewrite ^/xxxx/xxxx/ http://wikipedia.com/xx http://midomain.com/yyyy permanent;
重寫"^/xxxx/xxxx/ http://wikipedia.com/xx" http://midomain.com/yyyy permanent;
重寫 ^/xxxx/xxxx/ http://wikipedia.com/xx http://midomain.com/yyyy permanent;
重寫"^/xxxx/xxxx/ http://wikipedia.com/xx" http://midomain.com/yyyy permanent;
重寫 ^/xxxx/xxxx/ http://wikipedia.com/xx/$ http://midomain.com/yyyy permanent;
重寫"^/xxxx/xxxx/ http://wikipedia.com/xx/$" http://midomain.com/yyyy permanent;
重寫 ^/xxxx/xxxx/ http://wikipedia.com/xx/$ http://midomain.com/yyyy permanent;
我不知道我是否做錯了什么。
uj5u.com熱心網友回復:
Nginx在通過rewrite處理URI之前對其進行了規范化處理。 被決議為一個字面的空格字符,連續的/字符被替換為一個/。就是這最后一點給你帶來了麻煩。
例如:
重寫"^/xxxx/xxxx/ http:/wikipedia.com/xx$" http://midomain.com/yyyy permanent;
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/320530.html
標籤:
