0

我有一个这样的传入网址:

http://api.example.com/get/user/12345/posts?limit=10&offset=0&order=desc&record=type,date

我需要将其重写为(伪代码)

[DocumentRoot]/dispatch.php?url=http://api.example.com/get/user/12345/posts?limit=10&offset=0&order=desc&record=type,date

对它完全陌生,所以最好的情况是你可以给我整个=VirtualHost=块。

谢谢

4

1 回答 1

0
RewriteEngine on
RewriteRule ^(.*)/(.*)/(.*)/(.*)$ [DocumentRoot]/dispatch.php/$1/$2/$3/$4 [L,QSA]

mh 对于 htaccess 文件(mod rewrite),据我所知,您可以将其直接添加到您的虚拟主机(但请阅读如何做到这一点)

于 2011-05-14T19:39:07.253 回答