• My server (apache document) root is /srv/www/folder. Multiple copies of WP (1.5.1.2), each with their own database) are installed in:
    – /srv/www/folder/WP1
    – /srv/www/folder/WP2 (etc.)

    The sites are available on the web (obviously) as https://www.mysite.com, https://www.mysite.com/WP1 and https://www.mysite.com/WP2, and so on.

    Question: can I use one htaccess file in /srv/www/folder that will impact all the “folder”, WP1, WP2 (and so on) sites, or does each site need its own htaccess file. The htaccess files will be all the same, BTW, except for one that might need some more entries in it. Does this change anything? TIA.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Well, I guess you could have one .htaccess file in the root, but you’d have to change all the rules WP produces and it seems like a lot of error-prone work. Is it not acceptable to have two .htaccess files?

    Moderator James Huff

    (@macmanx)

    Each blog will need its own .htaccess file. It is acceptable to have one .htaccess file per directory/subdomain.

    Thread Starter sorenson2743

    (@sorenson2743)

    Hmmm. If I want to cut off any “bad” referrers, IPs, etc., could I do this at the root with a “get rid of these jerks before they go any farther” htaccess file, then have a htaccess file in each downstream WP directory that performs only stuff for that site? That is (using the directory layout in my initial post):

    /srv contains the “get rid of the jerks” htaccess file;

    /srv/www/folder/WP1 (or WP2) just have their unique localized htaccess file.

    Would this work to get rid of the spammers (relatively speaking) even before they get down/into to the blog code execution level?

    Thread Starter sorenson2743

    (@sorenson2743)

    Further on my post above.

    I guess the real question is if Apache parses the htaccess file in each directory in the path to a blog, before it parses the one in the blog, and therefore the jerks won’t even get to the blog. If not, I would have to duplicate all the “get rid of the jerks” htaccess entries in each of the blog htaccess files.

    I don’t know if it’s a performance consideration at all, having Apache parse the same “get rid of” entries versus just doing it once. But I do know that it’s a lot easier for me to maintain one “get rid of” htaccess file than multiple.

    Moderator James Huff

    (@macmanx)

    Hmmm. If I want to cut off any “bad” referrers, IPs, etc., could I do this at the root with a “get rid of these jerks before they go any farther” htaccess file, then have a htaccess file in each downstream WP directory that performs only stuff for that site?

    Yes, each .htaccess file affects the directory that it’s in and any directories below that.

    where can i find “An Introduction to the .htaccess file”?

    in my “dashboard” admin panel, i get a message when attempting to pull up the .htaccess file that it doesn’t exist. i traced everything back to the extracted achive here on my local machine (what i uploaded during installation), and i don’t see that file.

    should the Linux server have put it there? and if yes, then what can i do to get one there manually? should i investigate why it didn’t go there automatically if that’s what’s supposed to happen? should i be worried?

    rock and roll. thanks much!

    i’ve used a BSDi server for many years, but for no advanced purposes. most of my “web master/ server admin” learning, advanced as i got there, took place on a windows server. i’ve only recently started administering a Linux server, so i’m still getting used to the differences. much of this is not completely unfamiliar to me, but in terms of “okay, now, what do i do with this?…”, i’m still getting the hang of everything. fortunately, i was already knowledgeable of Change Mode and all that jazz. ??

    thanks again!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘One, or more, htaccess files needed?’ is closed to new replies.