Forum Moderators: phranque
Options +SymLinksifOwnerMatch
RewriteEngine On
# BELOW IS STUFF TO BLOCK SPAMMING ATTACKS
######################################################
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [NC,L]
#
######################################################
# GETTING PLATFORM AND PAGE NO
# http://big-blue-widget.example.com/big-widgets/greatest-gadget/p1pg2.html
RewriteRule ^[\.0-9,:\/-a-z]+p([0-9]+)pg([0-9]+)\.html$ index.php?p=$1&pg=$2 [NC,QSA,L]
# GETTING PLATFORM AND PAGE NO
# http://big-blue-widget.example.com/big-widgets/greatest-gadget/p1pg2.html
RewriteRule ^[\.0-9,:\/-a-z]+p([0-9]+)pg([0-9]+)\.html$ index.php?p=$1&pg=$2 [NC,QSA,L]
# GETTING PLATFORM AND CAT POSITION
# http://big-blue-widget.example.com/big-widgets/p1c9k7.html
RewriteRule ^[\.0-9,:\/-a-z]+p([0-9]+)c([0-9]+)k([0-9]+)\.html$ index.php?p=$1&c=$2&k=$3 [NC,QSA,L]
# GETTING PLATFORM AND CLIENT NO
RewriteRule ^[\.0-9,:\/-a-z]+p([0-9]+)cl([0-9]+)\.html$ index.php?p=$1&cl=$2 [NC,L]
# GETTING PLATFORM NAME
RewriteCond %{HTTP_HOST} ^(.+).example.org$ [NC]
RewriteCond %{HTTP_HOST} !^www.example.org$ [NC]
RewriteRule ^.*$ http://example.org/index.php?n=%1 [NC,QSA,L]
# I have deliberately commented out the rules below.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ http://example.org/index.php?m=$1&pg=1 [NC,QSA,L]
[edited by: not2easy at 8:10 pm (utc) on Sep 1, 2016]
[edit reason] Please remember to use example.com or example.org and not post specifics [/edit]
This site can’t be reached
red-widgets.example.org’s server DNS address could not be found.