homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Dynamic htaccess

10+ Year Member

Msg#: 4344927 posted 10:48 am on Jul 28, 2011 (gmt 0)

Dear all,

I have a question, hopefully your answer contradicts my expectations.

5 domains all point to the same directory on my server. Is it possible to load a unique .htaccess file per domain?



WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Msg#: 4344927 posted 9:02 pm on Jul 28, 2011 (gmt 0)

You can't have more than one htaccess file in the same location. But how do the domains get pointed in the first place? Put the htaccesses back there-- or put the equivalent information in the five separate config files if they exist. Do all five domains live on the same server? The wording of the question was ambiguous.

Option B is to include some version of {THE_REQUEST} in each separate set of rules, so users get differently routed depending on what they originally asked for (as distinct from where they are now). I foresee an icky mess in this case.

Deeper, philosophical issue: if you want things to behave differently depending on where the request came from, you may be merging the requests too soon. Put all the domain-specific stuff back in the originating domain, and reserve that final directory for things that will be handled exactly the same regardless of source.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved