Latest Register Log In

+ Advanced Search

Redirects

Redirects
By
09/05/17

Sometimes you want to control where the user will be sent after their interaction with the page. For common cases, you can control this at Admin -> Miscellaneous -> Manage Redirects. For custom cases, you can modify a form or link to specify a return URL.

For links, just add a 'returnto' parameter specifying the relative in-site URL. For example, index.php?action=userlogin&returnto=index.php?TID=somecustomtemplate will prompt for login and then go to index.php?TID=somecustomtemplate after they log in. Note that this won't work if there's an & in the URL you want to redirect too, because it'll be interpreted as an & in the link URL separating parameters -- for such a case, your best bet is to set up a friendlier URL for that page in your Admin -> Settings -> SEO.

In a form, you can embed a hidden field <input type="hidden" name="returnto" value="index.php?TID=somecustomtemplate">

To redirect back to the current page, use {CURRENTRELATIVEURL}. For example, <a href="index.php?action=userlogin&returnto={CURRENTRELATIVEURL}">click here to login and then redirect</a>. Note that this *will* work with &s in link form because it encodes them.




Rating
Views 62 views. Averaging 0 views per day.