Mod Rewrite Close
Use buttons above to get extra information

File Name:
File Size: Bytes
Tags:
Description:

 

Mod Rewrite Examples.


 

Anti Leech:

RewriteRule ^/ANTILEECH_IMAGE.jpeg$ - [PT,L]
RewriteCond %{HTTP_REFERER} ^.*LEECHERDOMAIN.NAME*$ [NC]
RewriteRule .*\.(bmp|gif|tif|tiff|jpeg|jpg|png¦mpg¦mpeg¦zip¦exe¦avi¦mov¦s
wf)$ http://MYSITE/ANTILEECH_IMAGE.jpeg [R,NC]

 

Fancy Redirects and Passthrough:

RewriteEngine On
RewriteBase /
#   Required For embedding withing Flowplayer and many other swf apps
RedirectMatch /stream/(.*)\.(.*)    /?h32_Item=$1\&s_action=View\&s_extension=$2 [L]
RedirectMatch /stream/(.*)      /?h32_Item=$1\&s_action=Get [L]
#   Anti Upload phpshells
RedirectMatch /templates_c/(.*)         /index.php?s_antihack=log&$1 [L]
RedirectMatch /images/(.*\.php)         /index.php?s_antihack=log&$1 [L]
#   Fancy URLs, Directory passthroughs
RewriteCond %{REQUEST_URI} ^/templates/.*$
RewriteRule .*\.(css|jpeg|jpg|gif|js|png|html)$ -   [R,L]
RewriteCond %{REQUEST_URI} ^/javascript/.*$
RewriteRule .*\.(css|jpeg|jpg|gif|js|html)$ -   [R,L]
RewriteCond %{REQUEST_URI} ^/tools/.*$
RewriteRule .*\.(css|jpeg|jpg|gif|js|png|html)$ -   [R,L]
RewriteCond %{REQUEST_URI} ^/images/.*$
RewriteRule .*\.(jpeg|jpg|gif|png)$ -   [R,L]
#   Crawler-friendly URLs
RewriteCond %{REQUEST_URI}  ,.*$
RewriteRule ^([^,]+),([^,]+),([^,]+),([^,]+)$   /?s_manager=$1\&s_itemkind=$2\&s_action=$3\&h32_Item=$4 [L]
RewriteRule ^([^,]+),([^,]+),([^,]+)$   /?s_action=$1\&h32_Item=$2\&h32_ItemView=$3 [L]
RewriteRule ^([^,]+),([^,]+)$       /?s_action=$1\&h32_Item=$2 [L]
#   Stuff for category-subdomains
RewriteCond %{HTTP_HOST}                    [^.]+\.devel\.\.tv
RewriteRule ^(.+)                       %{HTTP_HOST}$1          [C]
RewriteRule ^([^.]+)\.devel\.\.tv(.*)   http://sputnik.gnun.net/index.php?s_category=$1

 

Anti Spider:

RewriteEngine On
#"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
RewriteCond  %{REQUEST_METHOD}      ^POST$
RewriteCond  %{HTTP_USER_AGENT}        "Mozilla/4.0 \(compatible; MSIE 6.0; Windows NT 5.1; SV1\)"
RewriteRule  /node/add/faq$   /detected [L]