Apache .htaccess重写规则

时间:2012-11-11 16:15:25

标签: apache .htaccess

我需要重写这个网址

http://www.website.com/game/newscore.php
http://www.website.com/game/index.php?act=Arcade&do=newscore
http://www.website.com/game/index.php?act=Arcade&do=savescore

一体化

http://www.website.com/savescore

http://www.website.com/game/index.php?act=Arcade&do=verifyscore

http://www.website.com/game/verifyscore

这是我当前的.htaccess文件

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

有人可以帮我吗? 总而言之。

1 个答案:

答案 0 :(得分:1)

RewriteRule ^http://www.website.com/game/newscore.php$ http://www.website.com/savescore [R,L]
RewriteRule ^http://www.website.com/game/index.php?act=Arcade&do=(new|save)score$ http://www.website.com/savescore [R,L]
RewriteRule ^http://www.website.com/game/index.php?act=Arcade&do=verifyscore$ http://www.website.com/game/verifyscore [R,L]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]