httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rui Hu <tchrb...@gmail.com>
Subject [users@httpd] questions about mod_rewrite
Date Sat, 17 Dec 2011 11:52:59 GMT
hi,

I have a question about mod_rewrite. I want to implement a function based
on this module. When users send a request with such url:
1000.xyz.com/test.php or 2000.xyz.com/test.php. Without rewrite module,
original apache will get absolute paths as follows: $DOCUMENT_ROOT/test.php
and $DOCUMENT_ROOT/test.php.
I expect configured rewrite module will translate this url to an absolute
file path: $DOCUMENT_ROOT/1000/test.php and $DOCUMENT_ROOT/2000/test.php.
Namely, the first region of url. Therefore, rewrite module should parse the
request url to get the first region and constitute new url by adding it to
the middle of DOCUMENT_ROOT and REQUEST_URI.

How can I implement this function based on rewrite module? Really
appreciate your help.

-- 
Best regards,

Rui Hu
----------------------------------------------------------------------------------------
State Key Laboratory of Networking & Switching Technology
Beijing University of Posts and Telecommunications(BUPT)
MSN: tchrbupt@gmail.com
-----------------------------------------------------------------------------------------

Mime
View raw message