[英]URL rewrite rules not working
當前網址
http://mywebsite.com/explore.php?location=india&search_query=about&filter[]=v
所需的URL
http://mywebsite.com/explore/india/about/v
使用的規則:
RewriteRule ^explore/([^/]*)/([^/]*)/([^/]*)$ /explore.php?location=$1&search_query=$2&filter[]=$3 [L]
您忘記指定您的單詞可以超過一個字符。 我認為您需要更多類似的東西:
RewriteEngine on
RewriteRule ^explore/([^/]*)/([^/]*)/([^/]*)$ /explore.php?location=$1&search_query=$2&filter[]=$3 [L]
用
http://mywebsite.com/explore/india/about/v
如果在explore.php
輸出$_GET
,則會得到:
array(3) {
["location"]=> string(5) "india"
["search_query"]=> string(5) "about"
["filter"]=> array(1) {
[0]=> string(6) "v"
}
}
您的實際RewriteRule
適用於:
http://mywebsite.com/explore/i/a/v
希望能幫助到你
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.