1

how do I rewrite this url with .htaccess mod_rewrite

http://55.100.10.66:81/var/class/tag?isAjax=true&id=189&key=eJwVxzEOwjAMB&callback=_prototypeJSONPCallback_0

to

http://55.100.10.66:81/index.php/var/class/tag?isAjax=true&id=189&key=eJwVxzEOwjAMB&callback=_prototypeJSONPCallback_0

Amongst a lot of things I tried the below which doesn't work

RewriteRule ^var/class/tag(.*) /index.php/var/class/tag$1 [L,NC,QSA]

Thanks!

This is the solution

RewriteCond %{REQUEST_URI} ^/var/class/tag(.*)
RewriteRule .* index.php [L]
4

1 回答 1

0

您无法匹配 RewriteRule 中的 QUERY_STRING。通过启用 mod_rewrite 和 .htaccess httpd.conf,然后将此代码放在您.htaccessDOCUMENT_ROOT目录下:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^(var/class/tag/?)$ /index.php/$1 [L,NC]
于 2013-08-26T14:41:15.140 回答