You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Erik Sorenson <er...@amtelecom.net> on 2005/10/03 16:34:05 UTC

[users@httpd] Best place for .htaccess to work ... multiple sites

Using Suse 9.3, Apache 2 and hosting two 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 crawlers, indexers, etc., even before they get to the
sites (if possible).   Is is possible to put this in, say, /srv or /srv/ww
to cover both sites, rather than a copy of the .htaccess file in each
document root?  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.  TIA.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Best place for .htaccess to work ... multiple sites

Posted by Joshua Slive <js...@gmail.com>.
On 10/3/05, Erik Sorenson <er...@amtelecom.net> wrote:
> Using Suse 9.3, Apache 2 and hosting two 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 crawlers, indexers, etc., even before they get to the
> sites (if possible).   Is is possible to put this in, say, /srv or /srv/ww
> to cover both sites, rather than a copy of the .htaccess file in each
> document root?  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.  TIA.

Yes, you can put them in a parent directory, provided that
AllowOverride is set correctly for that parent directory in
httpd.conf.  It would be more efficient, however, to put them directly
in a a <directory> section in httpd.conf.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org