Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

One website, two domain names?


Reply

4 Posts   1341 Views

Avatar
bones

3 September 2009 at 8:20pm Community Member, 104 Posts

I have a website which is split into two, as there are two distinct parts of the business. I would like each to have its own domain name. The second domain name is parked on the server, so whether a visitor enters www.domain1.com or www.domain2.com, they are directed to the "normal" homepage.

I would like users entering www.domain1.com to continue to go to the "normal" homepage, and users entering www.domain2.com to go to /domain2/

I had thought that this would be a simple case of putting a 301 redirect on the server, but that doesn't work for some reason.

My host has suggested .htaccess rewrites, but I don't know if this would work (and have no idea how to do it anyway).

Can anybody help me, please?

Avatar
bones

9 September 2009 at 8:41pm Community Member, 104 Posts

My host has been looking into this for me too, but we still have no answers. Can anybody help, please?

Thanks

Avatar
Willr

9 September 2009 at 8:51pm Forum Moderator, 5511 Posts

Maybe something like

RewriteCond %{HTTP_HOST} ^www.domain2.com$ [NC]
RewriteRule ^(.*)$ http://www.domain1.com/domain2/$1 [R=301,L]

That will redirect everything from domain2 to that bottom url using a 301.

Avatar
bones

10 September 2009 at 8:32pm Community Member, 104 Posts

Thanks for your reply.

Unfortunately, my host and I have tried that and it doesn't work.

In their words: "I tried adding rewrites to your .htaccess but it follows that if your redirecting the root to a subfolder, and your parking a domain onto the route, the parked domain will point to the same place as the main domain."

Is there any other way around this?

Thanks