PDA

View Full Version : need to redirect a domain to a specific page in my site, help!



Lcars08
12-06-2008, 10:12 AM
I've just redid my website and have purchased a few domains, I'm trying to find a way to direct the new domain name(i.e. www. otherdomain.com) directly to a page( i.e. www.main domain/ page2.html) on my main website and not to the main home page for the site. Tech support at Westhost was unsure on how to do this and the control panel doesn't help either, Any suggestions!!!!!

Kevin

bruce.binder
12-06-2008, 10:53 AM
Lcars08:

Let me first ask a more basic question. Do you want each domain to have its own website? If that is your goal, the control panel gives you the option to point each domain to it's own "web directory" or "web root directory."

If you want each domain to have its own "landing page" but other than that, each domain should access the same website, then the tool mod_rewrite is probably what you want to use.

We can provide more details if you need help. Let us know which solution you're looking for (you might even find a solution in a previous discussion in these forums.)

--
Bruce

Lcars08
12-15-2008, 03:33 PM
Hey Bruce,
Yeah the Landing page is it. How do I make this happen?
kevin

bruce.binder
12-15-2008, 09:51 PM
Kevin:

I think this will do what your are looking for. This solution uses mod_rewrite, which is installed by default on you Westhost account.


RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} ^www\.otherdomain\.com$
RewriteRule ^$ maindomain.com/landingpage.html [L]

Put the above in a file called .htaccess in your web root directory.

I recommend reading up on mod_rewrite if you want to start doing more sophisticated things with it. There are a lot of discussions on this forum about it, or any web search should turn up plenty.

If you have a *lot* of domains, check out a solution similar to http://forums.westhost.com/showthread.php?t=10919 It's not exactly the same but the idea should work.

--
Bruce

firelf
12-17-2008, 07:15 PM
How long does it take for this method to work? Is it immediate, or does it need to proliferate throughout the DNS system?

wildjokerdesign
12-18-2008, 07:05 AM
The use of mod_rewrite in a .htaccess file should work the moment you upload the file to the directory on your server. Now if you happen to place the same rules in your httpd.conf file then you would have to restart the server/account for the new rule to be in affect.

Lcars08
12-23-2008, 02:26 PM
Thanks
I'll let you know how it works