Forum Moderators: phranque

Message Too Old, No Replies

forward based on requested host?

         

mkj552

4:52 pm on Aug 1, 2003 (gmt 0)

10+ Year Member



Ok, here is what I want to do.

I have a domain pointing to my main directory i want to get autoforwarded to another directory.

Example: Accessing bbbb.com goes to bbbb.com/1/ and all page requests for bbbb.com/index.htm goes to bbbb.com/1/index.htm.

Any ideas? TIA.

mkj552

11:51 pm on Aug 1, 2003 (gmt 0)

10+ Year Member



This is what I have, and it isn't working:

RewriteCond %{HTTP_HOST}!^(www\.)?siterequested\.com
RewriteRule ^(.*)$ /1/$1 [L]

jdMorgan

1:35 am on Aug 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mkj552,

Welcome to WebmasterWorld [webmasterworld.com]!

How do you intend to forward based on the requested host? You mention that in the title, but I see no description of your intent.

Jim

mkj552

3:56 am on Aug 2, 2003 (gmt 0)

10+ Year Member



I want to use a different directory if the requested domain is "bbbb.com". Example: If my main domain is aaaa.com, it uses the regular directory. If they use bbbb.com, i want it to use a "/1/" directory, preferably transparently.

Thanks in advance. :)

jdMorgan

4:41 am on Aug 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm...

Well, unless you were missing a space before the "!", what you had should have worked. How about:


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?bbbb\.com [NC]
RewriteCond %{REQUEST_URI} !^/1
RewriteRule ^(.*)$ /1/$1 [L]

Jim

mkj552

4:43 am on Aug 2, 2003 (gmt 0)

10+ Year Member



Thanks! that works great. :)