• Hello everybody,
    after tens of years of using WordPress, since the very first versions, I still have a beginner’s doubt.
    I often install WordPress in a folder under the site root, for example / wp.
    The instructions say that you have to COPY the .htaccess file located in the root folder. Ok. I always do it.
    Some plugins, however, write to the .htaccess file and it seems to me that they write to the one in the root …
    But the documentation says, if I understand correctly, that the .htaccess that is read by WP is the one in the installation folder, where there is the config_wp …
    In this way there is a misalignment between the two .htaccess, the one in the root and the one in the subfolder.
    So how do you have to behave about it?
    Which of the two is read and executed by WordPress?
    I’m confused.
    Thanks, Simone

    • This topic was modified 2 years, 5 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
  • Dion

    (@diondesigns)

    WordPress does not execute .htaccess files, they are executed by the Apache/Litespeed webserver. The only thing WP does with .htaccess files is add/delete directives to allow its REST API and “pretty URL” rewrite systems to work. Plugins can add directives, in some cases a stupidly large number of them. If you find a plugin that writes to a .htaccess file outside the WP filesystem, DO NOT USE IT if you have any other application within the document root. (Wordfence is notorious for this.)

    Which instructions are telling you to copy .htaccess files from the document root to a subdirectory? That should never be done because the .htaccess file in the document root is always executed before any .htaccess file in a subdirectory.

Viewing 1 replies (of 1 total)
  • The topic ‘the one ad only .htaccess, but which one?’ is closed to new replies.