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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

Redirect on login to current page. Redirector Page. Variable URL on Redirector?

Go to End



Community Member, 18 Posts

6 April 2013 at 1:57pm

Edited: 06/04/2013 2:01pm

So we have multiple sites.

The behavior of one has a footer template so that a Login link appears at the bottom of every page. After successful login, the user is redirected to a logged in version of the page they clicked the login link from.

The <a href> in the looks like:
<a href="Security/login?BackURL=$UrlLink" title="Login">Login</a>

So the page to return to when the page is rendered has been dynamically generated. So it will be<whatever_page#_currently_on>;

This works quite well.

However another site we have hasn't got the login links set up that way, but rather there is a 'Login' page within the site tree of the CMS that is a Redirector Page. The page it is set to go to is basically our home page. Under the 'Behavior' tab the ' Show in Footer Menu?' is checked.

On the Redirector Page under Content -> Main tab it looks like:

This page will redirect users to another page:
- Redirect to
- - Other website URL
- - -

So that behavior makes sense. However it would be much preferable to get redirected after the login to the page one clicked the login link from.

My question is, from within the CMS, on the redirector page, is their a way to redirect to a dynamically generated page? So the link ends up dynamically generated to correspond to whatever page you are on?

So it looks like:

This page will redirect users to another page:
- Redirect to
- - Other website URL
- - -<whatever page # currently on>

I'm trying permutations of:

However I just end up back on the home page after login.

When I use:$UrlLink

the result is a white page in the browser displaying just this line:

The action '$UrlLink' does not exist in class Security