Where to place Hummingbird .htaccess rules when WordPress has its own folder?

Hi

I have WordPress installed in a sub-directory "wp" under root. I set all the .htaccess properly, and the site loads just fine under the domain root (i.e. no "wp" in the URL's).

I've now installed Hummingbird, and it added some rules to the .htaccess under the root folder. I'm wondering: is this the right place for these rules, instead of the .htaccess under the "wp" folder?

I'm asking because when I installed WP Super Cache, it specifically asked for its .htaccess rules to be manually copied to the sub-directory version. It should be performed manually, as apparently WordPress can write only to the top level .htaccess.

So seeing Hummingbird's rules in the root's version, I was wondering whether I should copy them to the sub-directory version as well?

Thanks so much

yuda

    Adam Czajczyk

    Hello Yuda!

    I hope you're well today and thank you for your question!

    The Hummingbird's rules should be added to the main .htaccess files of your WordPress install. That's the one where all the default WP rules are placed. I suppose that there's a ".htaccess" file in your root folder that does something like this:

    RewriteEngine On
    RewriteBase /subfolder/

    If all the default WP rules are also there, please add Hummingbird's rules at the end of the file. If the WP rules are only on "sub-folder" .htaccess then add Hummingbird's rules there.

    I hope that makes sense

    Best regards,
    Adam

    yudayuda

    Thanks so much Adam for your reply. On the second time of reading, it made total sense

    But sadly it seems that WordPress doesn't work this way with .htaccess, so I'm still not sure where to put Hummingbird's rules...

    According the the codex, WordPress own htaccess rules are to be placed in both directories
    https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Basically the .htaccess file is copied to both dirs, with very minor differences, so I can't tell where the "default" WP rules are placed, and add Hummingbird's rules there.

    Also to note, that when I installed WP Super Cache, when it realized by itself that WP is installed in a sub-dir, it specifically asked me to copy the htaccess rules it placed in the root dir, to the sub-dir as well.

    So I can see 4 scenarios with regards to Hummingbird's htaccess rules:
    1) The rules must be placed ONLY in the ROOT dir level.
    2) The rules must be placed ONLY in the SUB-ROOT dir level.
    3) The rules must be placed in BOTH dirs (perhaps with some changes?).
    4) It doesn't really matter in which dir they are placed, as long as one of the htacess files contains them.

    I would love to get a clear reply on this one. I'm sure there are thousands of WPMUDEV clients who have WP installed in its own dir (this makes the root dir much cleaner, allowing easy installation & location of other apps), so a definite answer (and perhaps additions to the docs & installation process) would benefit us all

    Thanks a lot

    yuda

    Adam Czajczyk

    Hello Yuda!

    My suggestion was based on my own experience. Working with WordPress for all that years I have never used "double" .htaccess file even while keeping WP install inside its own sub directory. In fact I've got three test sites currently that are inside directories and they all do have a single .htaccess.

    I think however that I skipped an important info from you here and I'm sorry for this. The thing is the "sub-directory" install is not the same that "giving WP its own directory". The first one is when your WP is located in e.g. "/mysite" directory and it's available under the "domain.com/mysite" URL. The second one is when WP is still located in "/mysite" folder but it's available under "domain.com" URL. I suppose this is the scenario that you're referring to, is that correct?

    In my replay to you I was referring to the first case and this caused confusion. Again, I apologize for that!

    Having said that, I must admit I'm not quite sure what's the right answer here. I have forwarded your question to Hummingbirds devs and am awaiting their replay. Please keep an eye on this thread and I'll let you know once they explain it to me.

    Best regards,
    Adam

    Adam Czajczyk

    Hello Yuda!

    I got some help for this and a suggestion is to put these rules in a "subfolder .htaccess". However even if you put them into both of them that shouldn't do any "harm" as ".htaccess" is recursive.

    Therefore I would start with putting the rules into the ".htaccess" file in a subfolder and only add them (copied, not moved) to the one in a root folder if this wouldn't work. Subfolder option should be sufficient though.

    Best regards,
    Adam