我已經使用Apache mod_rewrite的模塊,我從一個GET請求檢索三個可變的問題,mod_rewrite的條件重定向
說
$country
$state
$location
我成功的在本地 改寫網址,例如網址
localhost/directory/country/state/location /*is redirected to*/
localhost/directory/result.php?c=country&s=state&l=location
我想要做的是,我要重定向
localhost/directory/country to localhost/directory/country.php?c=country
並在
localhost/directory/country/state to localhost/directory/state.php?c=country&s=state
情況下,我使用以下重寫規則
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ result.php?s=$1&d=$2&l=$3 [L]
我怎麼可以重寫櫃面國家和國家,並在情況下,如果我想只顯示國家頁..
非常感謝! 請幫我,通過向在線教程和其他參考文獻..
我將不勝感激你爲同一.. :)
複製與較少的佔位符,並與其它/縮短更換的URL規則/ PARAMS。 – mario