• Resolved Robert Eichhorn

    (@robert-eichhorn)


    I’ve read that one way to block access to the .htaccess file is with this code:

    <Files .htaccess=””>
    Order allow,deny
    Deny from all
    </Files>

    I don’t understand what [ .htaccess=”” ] means. The code doesn’t seem to establish a specific reference to any .htaccess files. Can you explain it?

    I’ve also read that WordPress needs write access to the .htaccess file to update it automatically. And Apache server software needs to read the .htaccess file. Will adding code to the .htaccess file to block access interfere with these functions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator t-p

    (@t-p)

    Try reviewing these documentation articles:

    Hardening WordPress

    Brute Force Attacks

    The .htaccess file allows you to make changes to the configuration of the website without needing access to the server. This is useful if you are on a shared hosting account.

    You can add code to the file, but ANY minor syntax mistake will break the website. So, ALWAYS take a backup of the file before making any changes.

    Add any new rules on a new line, ideally with a blank line space before and after each block of rules so you can locate them easily.

    Most blocks of rules have a comment line that starts with a # symbol. This line explains the purpose of the rule. e.g.

    # Block malicous IP addresses

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Questions about .htaccess code (1)’ is closed to new replies.