You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "J. Bakshi" <jo...@infoservices.in> on 2009/03/02 08:11:55 UTC

[users@httpd] How to read external config from .htaccess

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

---------------------------------------------------------------------
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] How to read external config from .htaccess

Posted by Frank Gingras <fr...@gmail.com>.
Brian Mearns wrote:
> On Mon, Mar 2, 2009 at 2:11 AM, J. Bakshi <jo...@infoservices.in> 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,
> -Brian
>
>   
Hello,

You can not, unfortunately, use the Include directive in the .htaccess 
context. Perhaps you can keep one master copy of your .htaccess file, 
and create symlinks to it in the desired contexts?

Frank

---------------------------------------------------------------------
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] How to read external config from .htaccess

Posted by Brian Mearns <me...@gmail.com>.
On Mon, Mar 2, 2009 at 2:11 AM, J. Bakshi <jo...@infoservices.in> 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,
-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
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