domain aliasing help requested

Using a single web hosting account to host multiple sites

domain aliasing help requested

Postby rsleventhal » Mon Nov 17, 2008 11:49 am

hi,

I'm hosting a site on a shared host which allows domain aliasing. So our primary domain is example.com. We currently point example2.com and example3.com to our root folder and all is well. This part is done with our hosting control panel. (in case it matters, this is the ensim, now parallels, pro x for linux cp).

I've just added example4.net and example4.com to our aliases. These now appropriately go to example.com's index page. Ideally, I'd love for any calls to example4.net or .com to go to a subpage on our main domain, like http://www.example.com/page.php

Is this possible with either rewrite or redirect? If so, might somone offer some insight as to how this can be done? I've tried a few things, but in my ignorance, wound up generating Error 500's, so I've removed my entries from the .htaccess file.

Thanks in advance,
-Ray
rsleventhal
 
Posts: 15
Joined: Thu May 15, 2008 7:17 am

Postby richardk » Mon Nov 17, 2008 12:23 pm

Try the following in a .htaccess file in your document root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?example4\.(com|net)$ [NC]
RewriteRule ^$ /page.php [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

[SOLVED]

Postby rsleventhal » Mon Nov 17, 2008 12:45 pm

Thank so much, richardk...

That worked *exactly* as I'd hoped!!

I truly appreciate your help and respect your depth of knowledge in this area.

Kindest regards,
-Ray
rsleventhal
 
Posts: 15
Joined: Thu May 15, 2008 7:17 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 28 guests

cron