如何重写此URL?

时间:2012-04-23 09:54:25

标签: .htaccess mod-rewrite

所以我想重写这个网址:

http://localhost/mock/foo.php?lang=eng&userID=2

要:

http://localhost/apiMethod.pl?lang=eng&userID=2

因此,当我在浏览器中调用http://localhost/apiMethod.pl?lang=eng&userID=2时,它实际上会转到http://localhost/mock/foo.php?lang=eng&userID=2

1 个答案:

答案 0 :(得分:1)

RewriteRule ^apiMethod\.pl$ mock/foo.php [QSA]