View Single Post
  #4  
Old 02-02-2013, 04:54 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
I did following tests with lsws, it's working as expected:
Code:
RewriteEngine On

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

RewriteRule .* /restricted.php [L]
no recursive loop. and no need ENV:REDIRECT_STATUS

PHP Code:
/usr/local/lsws/DEFAULT/html>cat keygenerator.php 
<?php

echo "this is keygenerator.php<br>"
echo 
"\$_SERVER[\"REQUEST_URI\"]=" $_SERVER["REQUEST_URI"];

?>
/usr/local/lsws/DEFAULT/html>cat restricted.php 
<?php

echo "this is restricted.php<br>"
echo 
"\$_SERVER[\"REQUEST_URI\"]=" $_SERVER["REQUEST_URI"];

?>
in browser, 192.168.2.101/genkey/01234567890abcdef01234567890abcdef
result:
Quote:
this is keygenerator.php
$_SERVER["REQUEST_URI"]=/genkey/01234567890abcdef01234567890abcdef
192.168.2.101/p.php?h=1
result:
Quote:
this is restricted.php
$_SERVER["REQUEST_URI"]=/p.php?h=1
Reply With Quote