http://thewebsitedemo.com/Just-dial/Chandigarh.php?categories=hotel&searchkeyword=tamarind
表单提交后我有上面的url。我想用'/'。
替换查询字符串静态变量例如。我需要这样的网址: http://thewebsitedemo.com/Just-dial/Chandigarh/hotel/tamarind
答案 0 :(得分:0)
尝试:
RewriteEngine On
RewriteCond %{THE_REQUEST} \ /+Just-dial/Chandigarh\.php\?categories=([^&]+)&searchkeyword=([^&\ ]+)
RewriteRule ^ /Just-dial/Chandigarh/%1/%2? [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^Just-dial/Chandigarh/([^/]+)/([^/]+)$ /Just-dial/Chandigarh.php?categories=$1&searchkeyword=$2 [L]