我有一个 PHP 脚本位于http://sb1.dev.codeanywhere.net/~a70097sb/hc/onlinestatus/image.php
这需要两个GET
变量:ign
and style
. My .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]
你走在正确的轨道上。捕获模式([^/]+)
匹配下一个之前的所有内容/
,所以你需要其中两个。
RewriteEngine On
RewriteRule ^([^/]+)/([^/]+)\.png$ image.php?style=$1&ign=$2 [L,NC]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)