Forum Moderators: phranque
http://localhost/putup.php that is supposed to /putup.php. When RULE 6 is http://localhost/putup.php are not found, and the http://localhost/putup.php is passed through /config/setup.php.
RewriteEngine On
RewriteBase /
SetEnv is_special foobar
#RULE 1 -Multiple slash rule doesnt handle leading slashes
#Forbid more than one leading slash
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/{2,} [NC]
RewriteRule ^ - [L,F]
#RULE 2 -Remove multiple slashes anywhere in URL
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R,L,QSA]
#RULE 3 -ReDirect empty requests to system organization
RewriteRule ^$ /palacegate [R=301,L,QSA]
#RULE 4 -ReDirect request for enter.php to system organiz
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /enter\.php\ HTTP/
RewriteRule ^enter\.php$ /palacegate [R=301,L,QSA]
#RULE 5 -Direct request for index.php to system organization
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ /palacegate [R=301,L,QSA]
#finally lower the draw bridge
#RULE 6 -Accept all requests except
# /enter.php or /putup.php
RewriteCond %{REQUEST_URI} !^$
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !^/enter.php$
RewriteCond %{REQUEST_URI} !^/putup.php$
RewriteRule !^(putup.php)$ /enter.php [PT,QSA]
#RULE 7 -Make alternate accomodation for /putup.php
RewriteCond %{REQUEST_URI} !^$
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !^/enter.php$
RewriteCond %{REQUEST_URI} ^/putup.php$
RewriteRule .* /config/setup.php [L,PT,QSA]
#RULE 2 -Remove multiple slashes anywhere in URL
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R,L,QSA] RewriteRule ^(([^/]+/)*)/+(.*)$ http://www.example.com/$1$3 [R=301,L]
RewriteCond %{REQUEST_URI} ^/putup\.php$
RewriteRule ^(putup\.php)$ /config/setup.php [NC,L,PT]
RewriteCond %{REQUEST_URI} !^/enter\.php$
RewriteCond %{REQUEST_URI} !^/config/setup\.php$
RewriteRule !^(/putup\.php)$ /enter.php [NC,L,PT]
[edited by: incrediBILL at 6:01 am (utc) on Dec 3, 2012]
[edit reason] No URLs to other forums, see TOS [/edit]
RewriteRule !^(/putup\.php)$ /enter.php [NC,L,PT] GET /this-page HTTP/1.1