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

header location in .ss template


Reply

2 Posts   711 Views

Avatar
DeklinKelly

28 May 2010 at 6:55am Community Member, 197 Posts

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

29 May 2010 at 4:12pm Forum Moderator, 5511 Posts

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.