0
但是,如果url以已知擴展名結尾(例如:.gif
,.png
),那麼它會將所有內容都路由到我的index.php
文件,但它會失敗並提供nginx 404錯誤頁面。怎麼來的?重寫以已知擴展結尾失敗,爲什麼?
我改寫如下:
location/{
try_files $uri $uri/ /index.php?$args;
}
此網址工作domain.com/attachment/53c386a876a56_ets2_00000
和使用index.php
文件。
這不起作用domain.com/attachment/53c386a876a56_ets2_00000.png
並給出404 Not Found nginx錯誤。
當我在url中有已知的擴展名時,爲什麼它不會被髮送到我的index.php
?
請發佈您的完整配置。 –