What's the correct way of performing a server-side redirect in custom Concrete5 code (5.7+)?
2
votes
2 Answers
3
votes
I discovered this is the best way:
(new RedirectResponse('/URL-HERE'))->send(); // 302 temporary
(new RedirectResponse('/URL-HERE', 301))->send(); // 301 permanent
You should be able to call this from (almost) anywhere within the app and not worry about namespaces since it has an alias in /concrete/config/app.php
.