questions about mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx
-----------------------------------------------------------------------------------------



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux