WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] htaccess - different if URL is mydomain.com/blog? (5 posts)

  1. gcoghill
    Member
    Posted 4 years ago #

    My webhost asked me to add hotlink protection via htaccess to track down some CPU hogging.

    My blog's URL is mydomain.com/blog

    I used this online tool to generate the htaccess code: http://www.htaccesstools.com/hotlink-protection/

    When I entered the URL, I entered it exactly as it is above. Is that correct? Also, does it matter where in the htaccess file the code is placed? I have it placed at the end of the file.

    It is preceded by the WP-Super Cache htaccess code, and then the standard WP permalinks code. After those two I added the hotlink code.

    When testing it on this page: http://www.htaccesstools.com/test-hotlink-protection/

    It doesn't seem to be working.

    I am not sure what I am doing wrong. I use htaccess in other non-WP areas of my site and it works OK (for 301 redirects and such) so I know htaccess is enabled and works.

  2. henkholland
    Member
    Posted 4 years ago #

    Did yo put it next to your index.php (in the directory blog)?

  3. gcoghill
    Member
    Posted 4 years ago #

    Yes I did. I also have htaccess file in the main site directory (xyz.com/.htaccess) and wondered if maybe that could be causing a conflict.

  4. henkholland
    Member
    Posted 4 years ago #

    When testing if the protection works, first empty your browsers cache/history etc
    Then you will get the red X

  5. gcoghill
    Member
    Posted 4 years ago #

    Ah you know what - I tried from another browser and it seems to be working. Thanks for the tip!

Topic Closed

This topic has been closed to new replies.

About this Topic