我的Nginx設置目前有這樣的:Nginx的重定向設置
location/{
if (!-e $request_filename){
rewrite ^/(.*)$ https://domain.com/index.php?id=$1 redirect;
}
}
基本上是不存在的網頁(404),它重定向用戶到主頁。但現在我有一個WordPress的博客設置https://domain.com/blog/,但任何wordpress項目,例如。 https://domain.com/blog/test也被重定向到主頁。我想知道如何解決這個問題?
爲你鏈接的是'ifIsEvil'頁解釋說,一個有回報或重寫是沒有問題的,所以這不是問題(儘管try_files通常是更好的方法) – cobaco