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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Redirecting domain to silverstripe page


Go to End


2 Posts   483 Views

Avatar
Apc204

Community Member, 12 Posts

28 February 2017 at 1:08am

Edited: 28/02/2017 1:09am

I have a main website running silverstripe say "mainsite.com" which has information about multiple different clubs "mainsite.com/club1/", "mainsite.com/club2/" etc.

I registered domains for these clubs, which I would like to rewrite to these pages. So when a visitor goes to "club1.com" it shows them the page at "mainsite.com/club1/".

I tried a couple of htaccess rules that I thought would work, but they don't seem to play nice with Silverstripe's own rewrites.
Tried the following:

RewriteCond %{HTTP_HOST} ^(www.)?club1\.com$
RewriteRule ^(.*)$ /club1/$1 [NC]

Directly after the Rewrite Engine On with no luck.

Is there any way to achieve what I am after in Silverstripe?

Avatar
martimiz

Forum Moderator, 1391 Posts

2 March 2017 at 11:39pm