3

我想重写我的链接

/svlist/sv_image.php?ip=109.73.77.38&port=35115&game=cs2d

/svlist/cs2d/109.73.77.38:35115.png

我对那东西真的很陌生。

RewriteRule ^(svlist)/([^.]*)\/([0-9]+):([^.]*)\.png$ $1/sv_image.php?ip=$3&port=$4&game=$2 [L,NC]

我试过这个,失败了。。

4

2 回答 2

1

尝试:

RewriteRule ^svlist/([^/]+)/([0-9.]+):([0-9]+)\.png$ /svlist/sv_image?ip=$2&port=$3&game=$1 [L,QSA]
于 2013-04-08T19:49:22.680 回答
0

如果你想重写/svlist/$var1/$var2:$var3.png/svlist/sv_image.php?ip=$var2&port=$var3&game=$var1你可以检查这个:

# once per .htaccess file
Options +FollowSymlinks
RewriteEngine on

RewriteRule ^svlist/([a-z0-9-_]+)/([0-9\.]*):([0-9]*).png /svlist/sv_image.php?ip=$2&port=$3&game=$1 [L,NC]

但是,如果您要重写的 URL 是/svlist/sv_image.php?ip=$var1&port=$var2&game=$var3/svlist/$var3/$var1:$var2.png然后尝试检查这些重写条件和规则:

RewriteCond %{QUERY_STRING} ip=([0-9\.]*)&port=([0-9]*)&game=([a-z0-9-_]+)
RewriteRule ^svlist/sv_image.php /svlist/%3/%1:%2.png [L,NC]
于 2013-04-08T20:16:21.087 回答