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.