Hi folks, I'm new here. I guess i'm somewhere between a newbie and intermediate mod_rewrite user, so I could really use some help on this one project I've been working on. I've got a rewritecond for 'test.php' which rewrites to a deny page if a query string is not met. If it is met, test.php is rewriten to test2.php with a env variable. The whole idea with the env variable is to make sure user goes to test2.php from test.php. How do I prevent a user from going directly to test2.php and bipassing the first page all together? One thing to clarify is, I "don't" want to pass the query string onto test2.php from test.php. That's why I dropped it in the last rewrite rule. Instead, I'm using the PHP getenv() in test2.php to grab the env. Help would be greatly appreciated since It's been killing me for the last two weeks and I can't seem to find any tuts on it. Here's what I got below:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{THE_REQUEST} test\.php [NC]
RewriteCond %{QUERY_STRING} !^string1=value$
RewriteRule ^test\.php http://my-domain.com/deny.html [L]
RewriteRule ^test2\.php - [E=passEnvVar:toTest2]
RewriteRule ^test\.php$ http://my-domain.com/test2.php? [R,L]
If any guru can give me a pointer, I can finally relax. Thanks.