我有一个 PHP 脚本,http://sb1.dev.codeanywhere.net/~a70097sb/hc/onlinestatus/image.php它需要两个GET变量:ign和style. 我的.htaccess文件与image.php.
我希望将表单的请求http://sb1.dev.codeanywhere.net/~a70097sb/hc/onlinestatus/{style}/{ign}.png重写为http://sb1.dev.codeanywhere.net/~a70097sb/hc/onlinestatus/image.php?style={style}&ign={ign}. 我该怎么做,因为我没有使用 mod_rewrite 的经验,并且无法使用我在 Google 上找到的任何教程来让它工作。
试过了,但没有用,我只是得到一个 404 页面:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteRule ^([^.]*)/([^.]*)\.png$ image.php?style=$1&ign=$2 [L,NC]