I've been working on a script for debugging mod_rewrite, and when testing their regex system I've had some strange results. I'm wondering if this is normal behavior for the mod_rewrite regex engine or if some part in my code is causing it.
Requested URL: http://myurl.com/path/to/something
.htaccess has: RewriteRule to where
Using my debugging system, the following is what happens when that RewriteRule is used:
path/to/something -> where/to/something
Shouldn't it be path/where/something
???
Here's the full .htaccess file
RewriteEngine On
RewriteBase /ModRewriteTester
RewriteRule .* - [E=ORIG:$0]
RewriteRule to where
RewriteRule .* - [E=MODD:$0]
RewriteRule .* index.php
Then I've got a php script that's reading in the environmental variables $_SERVER['REDIRECT_ORIG']
and $_SERVER['REDIRECT_MODD']
, that's where I'm getting the previously stated paths.
If anyone knows a better way to explicitly show how mod_rewrite's regex engine works I'm open to it. The initial question still stands though...