Best place for a multi-site .htaccess file?

Discussion regarding Joomla! security issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
sorenson2743
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Sep 15, 2005 6:52 pm
Location: Aylmer, ON Canada
Contact:

Best place for a multi-site .htaccess file?

Post by sorenson2743 » Mon Oct 03, 2005 3:08 pm

Using Suse 9.3, Apache 2 and hosting two Joomla sites currently, let's say X and Y.  Absolute paths and document roots are specified in vhost files as /srv/www/X and /srv/www/Y.

I have a ~400-line entry .htaccess file that has a lot of setenvifcase's in it, to block a lot of spammers, crawlers, indexers, etc., even before they get to the sites (if possible).  Is is possible to put this one file in, say, /srv or /srv/ww to cover both sites, rather than a copy of the .htaccess file in each document root?  I expect to update the (main) big .htaccess file a lot, and it would be simpler if I didn't have to merge the updates/new file with the .htaccess files in the various document roots.

Do I need to make sure of anything else?  The sites are already working fine, and .htaccess in document roots are already using mod_rewrite fine for SEF URLs.  TIA.

User avatar
kenmcd
Joomla! Champion
Joomla! Champion
Posts: 5672
Joined: Thu Aug 18, 2005 2:09 am
Location: California
Contact:

Re: Best place for a multi-site .htaccess file?

Post by kenmcd » Mon Oct 03, 2005 4:02 pm

Generally if you have access to the httpd.conf file it is better to put these items there.
The htaccess files are read every time the directory is accessed.
The httpd.conf file is read once when the server starts.

Putting the rules in the main body of the httpd.conf or using properly you should be able to have this affect both the virtual servers and only have to maintain one list.
██ LibreTraining

sorenson2743
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Sep 15, 2005 6:52 pm
Location: Aylmer, ON Canada
Contact:

Re: Best place for a multi-site .htaccess file?

Post by sorenson2743 » Mon Oct 03, 2005 5:28 pm

Good advice.  I'll give it a whirl.


Locked

Return to “Security - 1.0.x”