View Single Post
  #3  
Old 02-02-2013, 03:27 AM
Rumus.A Rumus.A is offline
New Member
 
Join Date: Feb 2013
Posts: 7
Default Test case

Actually I haven't test this yet.
(for now I'm working on apache server.)

However, this is a simple test case that I come up with.

When I want to allow only specific URI to pass to php script
but block everything else.

So I write it as

Code:
RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{THE_REQUEST} ^(?:post|get)\ /genkey/[0-9a-f]{32}\  [NC]
RewriteRule .* /keygenerator.php [L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule .* /restricted.php [L]
since
RewriteCond %{ENV:REDIRECT_STATUS} ^$
not work
and no other RewriteCond on
RewriteRule .* /restricted.php [L]

when
RewriteRule .* /keygenerator.php
executed
it also execute
RewriteRule .* /restricted.php

and when
RewriteRule .* /restricted.php
executed
It go recursive loop with the rule itself.

note: I haven't actually test this but I had some rewrite module test (When I found this problem during set up my software on LSWS.)
Reply With Quote