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.

Archive /

Our old forums are still available as a read-only archive.

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

301 Redirect


Go to End


4 Posts   2346 Views

Avatar
corkg

Community Member, 30 Posts

15 October 2008 at 7:42am

Hi

How can i make my site redirect so that:

http://mysite.com
goes to
http://www.mysite.com

like on the http://www.demconvention.com/ website which is silverstripe

Thanks

Avatar
(deleted)

Community Member, 473 Posts

15 October 2008 at 8:08am

Add:

Director::forceWWW()

to mysite/_config.php.

Or set up a rule in .htaccess that does it for you.

Avatar
corkg

Community Member, 30 Posts

15 October 2008 at 8:14am

thanks
works like a dream

Avatar
Liam

Community Member, 470 Posts

15 October 2008 at 8:40am

Neat, never knew you could add that to your config. Always did it through .htaccess.