[英]Nginx and 404 on try_files with .html
給定此SEF URL /attrazioni/madame-tussauds-londra.html
我需要調用真實的URL /index.php?q=/attrazioni/madame-tussauds-londra.html
我有此指令,但僅適用於SEF URL(不帶擴展名),在這種情況下/attrazioni/madame-tussauds-londra/
location {
try_files $uri $uri/ /index.php?q=$request_uri;
}
我錯了嗎? 為什么帶有尾部.html
的網址不起作用並返回404頁面?
不是真正的問題。 在try_files
之后,我的配置確實包括以下內容:
location ~* \.(html|htm|txt)$ {
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
expires 1d;
break;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.