我想重写我的链接
/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]
我试过这个,失败了。。
尝试:
RewriteRule ^svlist/([^/]+)/([0-9.]+):([0-9]+)\.png$ /svlist/sv_image?ip=$2&port=$3&game=$1 [L,QSA]
如果你想重写/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]