Forum Moderators: phranque

Message Too Old, No Replies

Directive for a particular .htaccess

Not to be inherited

         

anjanesh

4:37 am on Mar 13, 2008 (gmt 0)

10+ Year Member



Is there a way to specify an apache directive in .htaccess in a specific folder and have it not propagated to it's child folders ?

<OnlyForThisHTACCESS>
DirectoryIndex index.asp
</OnlyForThisHTACCESS>

I dont want a particular directive to be inherited.

Thanks

jdMorgan

4:27 pm on Mar 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's no direct solution. However, you could use mod_rewrite to make this URL-to-file association only within the current .htaccess file's directory:

Options +FollowSymLinks
RewriteEngine on
#
RewriteRule ^$ /filepath-to-index.asp-directory/index.asp [L]

Jim

anjanesh

4:55 pm on Mar 13, 2008 (gmt 0)

10+ Year Member



What I was really looking for was ...

Options +Indexes
IndexOptions +FancyIndexing +FoldersFirst

<OnlyForThisHTACCESS>
# Dont show parent-folder-link
IndexIgnore ..
</OnlyForThisHTACCESS>

But I want the parent-folder-link to be shown in all child-folders.

Is there no <IfThisDirectory> kinda thing ?

jdMorgan

5:14 pm on Mar 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use containers in httpd.conf or conf.d, if you have access to them.

[added] Alternately, put an .htaccess file in each child subdirectory to override the higher-directory's setting. [/added]

Jim

[edited by: jdMorgan at 5:15 pm (utc) on Mar. 13, 2008]