如果 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;
}
uj5u.com熱心網友回復:
=操作員不理解通配符,例如*. 您將需要使用正則運算式語法。
例如:
if ($args ~* "^fl=&fl=") { ... }
有關詳細資訊,請參閱此檔案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/498027.html
