[英]Nginx redirect to another page if url contain specific query string
如果 URL 包含以 fl=&fl= 開頭的查詢字符串,我想將所有 URL 重定向到另一個頁面
傳入的 URL 可以是任何以查詢字符串 fl=&fl= 開頭的內容
https://example.com/a-core/?fl=&fl=test&fl=test1&fl=xyz;&fl=test3&fl=test4&fl=test5
https://example.com/a-core/?fl=&fl=test&fl=test0&fl=cpl;&fl=test8&fl=test9&fl=test7
以上所有 URL 都以查詢字符串 fl=&fl= 開頭,需要重定向到 example2.com/test123
我試過這個但沒有用
if ($args = "fl=&fl=*") {
return 301 https://example2.com/test123;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.