I'm trying to use a mod_rewrite to turn out a URL in the form /test/12, which gets rewritten to test.php?id=12, using
For now, test.php just contains
The idea being the expected output from the page is
Except I don't get that, I just get Array ( ) - ie the ?id=$1 is getting chucked away. The result's exactly the same if I empty the .htaccess and disable mod_rewrite, so it would seem unlikely that mod_rewrite is the cause, but some Apache thing that's seeing the "test", and running off to test.php.
If I change the first "test" to "blahdeblah" in the RewriteRule, and change the URL to /bladeblah/12, everything works as expected.
Any suggestions to fix this, or is it something I have to work around?
Code:
RewriteRule test/([0-9]+)/$ test.php?id=$1
For now, test.php just contains
PHP:
<?php
print_r($_SERVER['argv']);
?>
The idea being the expected output from the page is
Array ( [0] => id=12 )
Except I don't get that, I just get Array ( ) - ie the ?id=$1 is getting chucked away. The result's exactly the same if I empty the .htaccess and disable mod_rewrite, so it would seem unlikely that mod_rewrite is the cause, but some Apache thing that's seeing the "test", and running off to test.php.
If I change the first "test" to "blahdeblah" in the RewriteRule, and change the URL to /bladeblah/12, everything works as expected.
Any suggestions to fix this, or is it something I have to work around?