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   735 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, 5513 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.