• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue htaccess hotlink protection issue with ip6

WiseWill

New Pleskian
Server operating system version
Ubuntu 24.04
Plesk version and microupdate number
18.0.68 Update #2
I have it where you go to the ip4 address and all images show in the browser. I was able to accomplish this by adding RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?217.160.146.1(/)? [NC] to the htacces file. I tried to add RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?2607:b500:400::01(/)? [NC] and the images won't show in the browser. I tried adding the /64 and /80 CIDR. I tried to add short and long addresses of the ip address.

I have an example of what I am trying to use.

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domainname.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domainname.org$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?217.160.146.1(/)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?2607:b500:400::01(/)? [NC]
RewriteRule .*\.(jpg|jpeg|gif|ico|png|bmp)$ - [F,NC]

I have read this should work. There is something I am missing, and I am just too close to it to see the forest through the trees. How should I be writing the file for ip6? I have tried to find a resource only through searches and there are not any that I could find. Thank you for your assistance.
 
As far as I'm aware, to utilize IPv6 directly in a browser you would need to put the IPv6 address in brackets ([IPv6:Add:res:s]). Don't know how it'll work in .htaccess in terms of how to add it but that should give you some clue.
 
Putting the IPv6 in square brackets would be correct, see this: https://www.ietf.org/rfc/rfc2732.txt

But how do you access your site via IPv6 for testing purposes currently if you don't know how to? I mean that this is a .htaccess independent problem/question in the first place.

And an IP can't have a subdomain like "www", so you can leave it out.

Please be aware that you have to escape the brackets as they are part of regular expressions. You should also escape dots, although this makes no difference in your example.
 
Back
Top