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);
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
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);
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.