Hi Ipstenu,
Thanks for your information. I used a similar site before with techniques to edit my .htaccess file to obtain hotlink protection. But unfortunately with no solution.
I’m afraid that there is something wrong/interfering with the codes in my current .htaccess file. Sorry I wasn’t aware enough about the forum rules. I now used pastebin to show you the code:
<script src="http://pastebin.com/embed_js.php?i=RCNGtEmy"></script>
Thanks for your help.
First put WordPress at the bottom and your hotlink at the top π
Then this stuff is … you have too much repetition.
Notic how you have *.myfirstdomain AND mail.myfirstdomain? You’re duplicating efforts.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$ [NC]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?myfirstdomain\. [NC]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?myseconddomain\. [NC]
RewriteRule \.(gif|jpe?g?|png|bmp)$ - [F,NC,L]
</ifModule>
That should be ALL you need.
Thanks a lot for your advice. I’m not an expert on this, sorry for that and for asking the following.
Can I delete all the code of my .htaccess file and replace them with the codes you gave me (putting my domain names in it)?
In other words: do I need this content for my .htaccess:
http://pastebin.com/embed_js.php?i=GQkST1sh
Or the one you gave me?
Hi, I tried what you suggested me in various ways, but it didn’t work. Can you please indicate me where I made an error?
1. First I tried the following code as entire code for the file:
<iframe src="http://pastebin.com/embed_iframe.php?i=mcwa37j2" style="border:none;width:100%"></iframe>
2. After that I tried only the code you suggested me for the file (without WP-codes):
<iframe src="http://pastebin.com/embed_iframe.php?i=dXSAHmMJ" style="border:none;width:100%"></iframe>
Is this piece of code always necessary in the .htaccess file?
<iframe src="http://pastebin.com/embed_iframe.php?i=7tsDDkiN" style="border:none;width:100%"></iframe>
Thanks!
Did you happen to notice how many extra slashes you have in there?
http://pastebin.com/4681dK4p
Hi Ipstenu,
I tried the last (pastebin) code you gave me but it doesn’t work. And besides that the images of ‘myfirstdomain.com’ don’t appear now. The ones of the seconddomain.com do appear normally.
Is there some code lacking in the beginning of the codes?
Thanks a lot for your help!
You’ll have to read the doc I linked to for other versions. Not all .htaccess setups are the same, and there’s always experimentation.
Hi,
I’m not an expert in this, but I tried everything that is suggested on the site you mentioned.
I have 2 domains (the 2nd is a so called add-on domain) and the 1st has WordPress Multisite enabled (sub-directories), I don’t know if that’s the problem.
I don’t know if you or anybody else can offer an alternative that can help me, honestly I don’t now what more I can do or where to ask for help.
Thanks.
Ask your webhost at this point, since they may have something set up to stop it from working. But that code is exactly what I use for my site with an add-on domain (and even for a domain that isn’t even mine – I like giving my tumblr account permissions to use my images). I know the code is valid for MOST sites.
Hi Ipstenu,
I solved the problem I had with the hotlink protection, thank you so much for your information!
Now I tried to give permission to the translator of Google (to add it to the whitelist), but it doesn’t work. I’ve tried the following 2 options:
RewriteCond %{HTTP_REFERER} !^http(s)?://(www|translate)\.?google.* [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?translate.google.com/.*$ [NC]
I can’t find information about this on the Internet, do you have a suggestion to solve this?
Thanks a lot in advance!
What’s the hotlink protection code you’re using? There are a few variants.
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?google\. [NC]
should do it
I will try this and will inform you about it.
Does this permit everything of Google?
Thanks a lot!