RewriteEngine On
RewriteBase /

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-([0-9]+_[0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}

########## poczatek - Rewrite rules - blokowanie niektorych
#znanych exploitow
#
# 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]
#

RewriteCond %{HTTP_USER_AGENT} ^arachnofilia*    [OR]
RewriteCond %{HTTP_USER_AGENT} ^aspseek*    [OR]
RewriteCond %{HTTP_USER_AGENT} ^bot*        [OR]
RewriteCond %{HTTP_USER_AGENT} ^check*        [OR]
RewriteCond %{HTTP_USER_AGENT} ^crawl*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^openfind*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^roamer*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^robot*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^rover*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^scooter*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^siphon*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^spider*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^sweep*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^walker*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^wisenutbot*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^gulliver*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^validator*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^yandex*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^moget@*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^teomaagent*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^infoNavirobot*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^PPhpDig*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^gigabaz*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Webclipping.com*    [OR]
RewriteCond %{HTTP_USER_AGENT} ^RRC*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^netmechanic*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^BackWeb*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bandit*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Buddy*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^Collector*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Copier*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Downloader*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^FileHound*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Grabber*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^HTTPClient*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^HTTrack*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mirror*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Recorder*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Sauger*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Snagger*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Snake*         [OR]
RewriteCond %{HTTP_USER_AGENT} ^Stripper*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Sucker*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSpider*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zyborg*     [OR]
RewriteCond %{HTTP_USER_AGENT} ^Pockey*                 [OR]
RewriteCond %{HTTP_USER_AGENT} ^QRVA*                   [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebMiner*               [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier*              [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Downloader*        [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebMirror*              [OR]
RewriteCond %{HTTP_USER_AGENT} ^Anarchie*               [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Down*             [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper*            [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebHook*                [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon           [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf             [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro          [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*NEWT         [OR]
RewriteCond %{HTTP_USER_AGENT} ^Crescent              [OR]
RewriteCond %{HTTP_USER_AGENT} ^CherryPicker          [OR]
RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit       [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebEMailExtrac.*      [OR]
RewriteCond %{HTTP_USER_AGENT} ^NICErsPRO             [OR]
RewriteCond %{HTTP_USER_AGENT} ^Telesoft              [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster         [OR]
RewriteCond %{HTTP_USER_AGENT} ^Microsoft.URL         [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector        [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zyborg/1.0.*
RewriteRule .* - [F]
