Forum Moderators: phranque
[edited by: jdMorgan at 1:48 pm (utc) on Apr 14, 2010]
[edit reason] Please use example.com only. [/edit]
# Externally redirect client requests for old dynamic urls to equivalent new static urls
#
# http://www.example.com/subcategory.php?subcatid=1&lang=gr -301-> http://www.example.com/folder/folder2/page2.html
#
RewriteCond %{QUERY_STRING} ^subcatid=1&lang=gr$
RewriteRule ^subcategory\.php$ http://www.example.com/folder/folder2/page2.html? [R=301,L]
##
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
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 [F,L]
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteCond %{QUERY_STRING} ^catid=11&subcatid=7$
RewriteRule ^subcategory\.php$ http://www.example.com/Tours/half-day-tour.htm? [R=301,L] [edited by: jdMorgan at 1:23 pm (utc) on May 24, 2010]
[edit reason] Do not post copyrighted material at WebmasterWorld [/edit]