httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Mearns <>
Subject Re: [users@httpd] How to read external config from .htaccess
Date Tue, 03 Mar 2009 13:37:21 GMT
On Mon, Mar 2, 2009 at 2:11 AM, J. Bakshi <> wrote:
> Dear list,
> I have a very long .htaccess. Because the .htaccess has all the config
> to block the web-graber, leaching protection , redirect rules, php.ini
> setting etc.....
> I like to place all the web-graber, leaching protection settings in a
> external files so that .htaccess call the files and it itself stay small
> and clean.
> How can I achieve this ? Also that file should be protected by .htaccess
> so that only .htaccess can read that file.
> Is it possible to do ?
> Please enlighten me.
> Thanks

You can certainly do this with the main server file (httpd.conf, for
instance) using the Include directive. I'm not sure if you can do this
in an htaccess, but it's probably worth a try. You can protect the
included files from web browsing in any number of standard ways, like
a <Files> or <FilesMatch> tag. If you have access to your server
config file, search through it to see how it prevents the server from
serving up the .htaccess files. I can't remember off hand exactly what
it uses, probably Deny from all and an Order directive.

Hope that help,

Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from:

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message