• Resolved oldmankit

    (@oldmankit)


    I’m trying to stop hotlinking. How do I change the following so that it allows hotlinking from any of the subdomains at peaceandtruth.com? (e.g. blog.peaceandtruth.com)

    ‘# block hotlinking
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^https://(www\.)?peaceandtruth.com/.*$ [NC]
    RewriteRule \.(gif|jpg|js|css)$ – [F]’

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Open your .htaccess file.

    Add that code ABOVE the calls to WordPress.

    Save.

    You’ll need some sort of FTP or file editing client on your PC to go edit the file, mind you. And you’ll need to make sure you ‘show hidden files’. Your host should have some directions on how they want you do that.

    Thread Starter oldmankit

    (@oldmankit)

    Thanks. What I am really looking for is to allow subdomains.

    The above code words fine (I’ve tried it), however, the only subdomain it allows is https://www.peaceandtruth.com. I want to allow all subdomains for peaceandtruth.com. e.g. blog.peaceandtruth.com.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Thanks. What I am really looking for is to allow subdomains.

    Oh ?? You’ll like this, then.

    https://perishablepress.com/press/2007/11/21/creating-the-ultimate-htaccess-anti-hotlinking-strategy/

    Thread Starter oldmankit

    (@oldmankit)

    Thanks for the link, it was very thorough. What I was looking for-a catch-all for any requests from my site- was something like this:

    https?://([^.]+\.)?peaceandtruth\.([^.]+\.)?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help modifying .htaccess’ is closed to new replies.