Welcome to WebmasterWorld Guest from 54.159.246.164

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Dynamic htaccess

   
10:48 am on Jul 28, 2011 (gmt 0)

10+ Year Member



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?
9:02 pm on Jul 28, 2011 (gmt 0)

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



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.