Ola there
I run several domains under the same shared hosting account, so I have the following files:
/home/joe/domain1.com/.htaccess
/home/joe/domain2.com/.htaccess
/home/joe/domain3.com/.htaccess
Each file contains duplicate data (stuff like deny from stupid.web.bot).
Is there any way to have a single file that’s shared across multiple .htacess files? (something like bash’s source command)
Use
httpd.includevhost configuration files (as found in/etc/httpd/conf.d/vhosts.confon RHEL systems) – these are preferable to.htaccessas they are loaded at server start and not dynamically, allowing.htaccessto be disabled and one less filesystem lookup required per directory lookup.Not all configuration directives can be used in
.htacessandhttpd.include, check the manual for specifics. Directory commands are fine.Use the
includedirective in yourhttpd.includeto include a base config file with common rules.