Jump to:

23491 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » One website, two domain names?

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

Page: 1
Go to End
Author Topic: 1332 Views
  • bones
    Avatar
    Community Member
    104 Posts

    One website, two domain names? Link to this post

    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?

  • bones
    Avatar
    Community Member
    104 Posts

    Re: One website, two domain names? Link to this post

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

    Thanks

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: One website, two domain names? Link to this post

    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.

  • bones
    Avatar
    Community Member
    104 Posts

    Re: One website, two domain names? Link to this post

    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

    1332 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.