• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • Our UX team believes in the in the power of direct feedback and would like to invite you to participate in interviews, tests, and surveys.
    To stay in the loop and never miss an opportunity to share your thoughts, please subscribe to our UX research program. If you were previously part of the Plesk UX research program, please re-subscribe to continue receiving our invitations.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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