5W site logo 5W - мой домашний сайт-блог с картинками, кино и плюшками.

admin-httaccess-razobrat.txt

RewriteEngine On
RewriteRule ^admin/$ /admin/index.htm [NC,L]

RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteRule ^.+$ http://www.bedtime.ru/ [R=301,L]

RewriteCond %{HTTP_HOST} ^bedtime\.ru$ [NC]
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteRule ^(.*)$ http://www.bedtime.ru/$1 [R=301,L]

Options FollowSymLinks

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bedtime.ru [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bigmag.ru [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bedmag.ru [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bigmag.ru/1/ [NC]

RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^cat([0-9]*)?/?$ ./new_index.php?cat=$1 [QSA]
RewriteRule ^item([0-9]*)?/?$ ./new_index.php?item=$1 [QSA]

RewriteRule ^item([0-9]*)?/?cat([0-9]*)?/?$ ./new_index.php?item=$1&cat=$2 [QSA]
RewriteRule ^cat([0-9]*)?/?item([0-9]*)?/?$ ./new_index.php?cat=$1&item=$2 [QSA]

RewriteRule ^([0-9,a-z,A-Z,+,_,-]*)_([0-9]*).html$ ./print.php?id=$2 [QSA]

RewriteRule ^taleid([0-9]*)?/?$ ./index.php?taleid=$1 [QSA]

RewriteRule ^mapitem?/?$ ./mapitem.php [QSA]

RewriteRule ^itemfull?/?$ ./new_index.php?mapitem [QSA]

RewriteRule ^cattt?/?$ ./new_index.php?cattt [QSA]

########## Начало - Правила обработки запросов для блокировки распространенных эксплоитов
## If you experience problems on your site block out the operations listed below
#
# 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 [F,L]
#
########## Конец - Правила обработки (Rewrite rules) для блокировки распространенных эксплоитов

RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}]