我有一个看起来像这样的网址
http://example.com/index.php的 CON =东西&安培;满足= MEH
我要做的是摆脱con=
和met=
,以便网址看起来像
http://example.com/index.php的 /东西/ MEH
这就是我到目前为止所做的事情
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ action=$1 [L,QSA]
RewriteRule ^(.*)$ page=$1 [L,QSA]
但没有任何变化,网址看起来仍然相同http://example.com/index.php ?con = something& met = meh
我做错了什么?
答案 0 :(得分:3)
我确实喜欢这个:
RewriteEngine on
RewriteRule ^index.php/([^/]+)/?([^/]*) /index.php?con=$1&meh=$2 [NC]
请注意,如果你没有传递任何meh,它仍然有效。