Hi,
I'm looking for some help with a mod_rewrite rule for apache.
I have this:
RewriteEngine On
RewriteBase /
#only use rewrite if the file being called does not exist!!!
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*) page.php?page=$1 [L,NE]
RewriteRule ^(.*) sample.php?page=$1 [L,NE]
It redirects all requests for non-existent files to the sample.php page. The problem is that it doesn't pass the querystring values (e.g. after a '?' in the following query:
"http://www.somewhere.com/nonexistentpage.php?id=3"
in this case I'd go to http://www.somewhere.com/sample.php?page=nonexistent.php what I'd like is something like http://www.somewhere.com/sample.php?page=nonexistent.php&id=3 or something similar that I can work with).
I'm looking for the proper rule which redirects as above but which also provides access to the original querystring in some easily used manner.
Thank you for your help!
Best Regards,
John