• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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