Forum Moderators: phranque
RewriteEngine on
RewriteRule ^[^:]*\.(php¦src¦jpg¦jpeg¦png¦gif¦bmp¦css¦js¦inc¦phtml¦pl¦ico¦html¦shtml)$ - [L,NC]
RewriteRule ^index.php?title - [L]
RewriteRule ^(.*)\&(.*)$ $1\%26$2
RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?mywebsite\.com($¦/) [NC]
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?myotherwebsite\.com($¦/) [NC]
RewriteRule \.(gif¦jpg¦jpeg¦png¦mp3¦mpg¦avi¦mov)$ - [F,NC]
I also have placed this in my images folder:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?mywebsite\.com($¦/) [NC]
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?myotherwebsite\.com($¦/) [NC]
RewriteRule \.(gif¦jpg¦jpeg¦png¦mp3¦mpg¦avi¦mov)$ - [F,NC] Whether I use the httaccess file in my image directory or use them in my root directory and image directory my site still allows hotlinking. I think rewrite rule for jpg's may have something to do with this. I can't disable the rewrites for jpgs because it would mess up image links on my site.
Any help on getting this to work?
Also be aware that you must change all broken pipe "¦" characters in code copied from WebmasterWorld to solid pipe characters before use; Posting on this forum modifies the pipe characters.
It is likely that "[^:]*" in your first rule should be "[^.]+" instead. Or you could omit the entire "^[^:]*" part entirely without changing the result.
Jim
Rufal - that may or may not be true (I'm thinking from my results it isn't), but on the other hand I am using VPS system with metered memory usage. When hotlinking is allowed my memory usage doubles and I have to pay double the price. So that in itself is a good enough reason for me to stop it. Cheers..