2011-05-14 34 views
0

我进来的URL是这样的:mod_rewrite的 - 从子域在文档根文件

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 =块。

THX

回答

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

MH,对于htaccess文件(MOD改写),则可以在据我所知直接添加到您的虚拟主机(但读如何做到这一点)