Welcome to WebmasterWorld Guest from 54.146.201.80

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

mod rewrite: distribution of domains on virtual host

     
2:15 am on Aug 7, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 9, 2003
posts:330
votes: 0


Here is what I want to do:

on a virtual server, I have the following domains:

d1.com, www.d1.com, d2.com, [...] that redirect to my root directory.

when a user types: d1.com/something they shoud be taken to: d1/index.php
when a user types: d2.com/someurl/asdf/ they shoud be taken to: d2/index.php

Formerly, I just had one domain where I used:

RewriteEngine On
RewriteRule .* d1/index.php [L]

Now, I need to modify this, so that I can use more than one domain.

Unfortunately, I couldn't find anything in Google. Thanks for your help!

--
globay

2:20 am on Aug 7, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 26, 2003
posts:881
votes: 0


globay:

I think they came up with a solution similar to what you are looking for, here:

[webmasterworld.com...]

Jordan

2:36 am on Aug 7, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


globay,

The linked thread above is for a different problem.

> when a user types: d1.com/something they shoud be taken to: d1/index.php
> when a user types: d2.com/someurl/asdf/ they shoud be taken to: d2/index.php
> Now, I need to modify this, so that I can use more than one domain.


RewriteCond %{HTTP_HOST} ^(www\.)?(.+)\.com [NC]
RewriteRule .* /%2/index.php [L]

(I assume you also want to redirect www.d1.com/<something> to /d1/index.php and www.d2.com/<something> to /d2/index.php. If not, delete the "(www\.)?" in the RewriteCond.)

Jim

3:18 am on Aug 7, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 9, 2003
posts:330
votes: 0


Jim,

thanks a lot! Thats exactly what I needed!

--
globay

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members