Forum Moderators: phranque

Message Too Old, No Replies

different vhosts with different welcome pages in same directory?

         

blitzer

5:54 am on Jun 9, 2005 (gmt 0)

10+ Year Member



Hi!

I'm not sure if I've really searched all threads for my problem ... I'm sure I'm not the first with this problem, but I didn't find a solution.

I've different virtual hosts:

l1.test.com ... l2.test.com etc and what I want is always a different welcome page in the SAME directory.

If request is l1.test.com, welcome page should be index.html?lang=en in directory /test,
if request is l2.test.com, welcome page should be index.html?lang=fr in directory /test, etc.

Of course, a simple solution is having different directories, but is it possible to define different welcome pages for different virtual hosts?

jdMorgan

3:48 pm on Jun 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



blitzer,

Welcome to WebmasterWorld!

Yes, you could use mod_rewrite. Use RewriteCond to test the requested subdomain in the {HTTP_HOST} server variable. Then rewrite requests for the welcome page such that the subdomain is used to select the "lang" parameter.

References for mod_rewrite and regular expressions can be found in our forum charter (link near top left of this page).

Jim

blitzer

7:20 am on Jun 11, 2005 (gmt 0)

10+ Year Member



Hi!

One problem I don't understand ...

RewriteRule îndex.\html$ index2.html works fine, but
RewriteRule îndex.\html$ index2.html?lang=en do not work! He ignores all behind '?', what's wrong?