使用.htaccess从url中删除两个GET参数
我有一个像这样的url ?con=something&met=meh 我想做的是去掉使用.htaccess从url中删除两个GET参数,.htaccess,parameters,get,.htaccess,Parameters,Get,我有一个像这样的url ?con=something&met=meh 我想做的是去掉con=和met=,这样url看起来就像 /something/meh 到目前为止我就是这么做的 RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ action=$1 [L,QSA] RewriteRule ^(.*)$ page=$1 [L,QSA
con=
和met=
,这样url看起来就像
/something/meh
到目前为止我就是这么做的
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ action=$1 [L,QSA]
RewriteRule ^(.*)$ page=$1 [L,QSA]
但是没有任何变化,url看起来还是一样的?con=something&met=meh
我做错了什么?我是这样做的:
RewriteEngine on
RewriteRule ^index.php/([^/]+)/?([^/]*) /index.php?con=$1&meh=$2 [NC]
请注意,如果您没有通过任何meh,它仍然有效。我喜欢这样:
RewriteEngine on
RewriteRule ^index.php/([^/]+)/?([^/]*) /index.php?con=$1&meh=$2 [NC]
请注意,如果您没有通过任何meh,它仍然有效。
RewriteRule^index.php/(.*)/(.*)$http://example.com/index.php?con=$1&met=$2
more?RewriteRule^index.php/(.*)/(.*))$ http://example.com/index.php?con=$1&met=$2
太多了?它在/index.php?con=$1&meh=$2
谢谢中没有/index.php?con=$1&meh=$2
谢谢