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

header location in .ss template


Go to End


2 Posts   1066 Views

Avatar
DeklinKelly

Community Member, 197 Posts

28 May 2010 at 6:55am

Is it possible to put something that does this at the top of a .ss template file?

header('Location: http://www.example.com/',TRUE,301);

Avatar
Willr

Forum Moderator, 5523 Posts

29 May 2010 at 4:12pm

Don't think so (since that code is PHP) you could use the HTML meta refresh

<meta http-equiv="REFRESH" content="0; url=http://www.yourdomain.com/index.html">

Otherwise you might need be create a custom function for it. Like $RedirectUser

function RedirectUser() {
header('Location: http://www.example.com/',TRUE,301);
}

If that works.