EE 2.7.2 Structure 3.3.13

I've got a site where I have a front end login form that is on all pages as a modal when clicking the login link in the header. Everything works fine, however for the redirect="" parameter I would like the form to redirect to the page it was filled out on.

using this code:

  {exp:member:login_form return="{page_url}"}
    <input type="text" name="username" value="" maxlength="32" size="25">

    <input type="password" name="password" value="" maxlength="32" size="25">

    <input type="submit" name="submit" value="Submit" class="button small">

results in a broken url http://domain.com/%7Bpage_url%7D

and a white page with this message

The URI you submitted has disallowed characters.

I tried using low variables and preparsing the {page_url} (same as embedding a template) but that also did not work.

Is there a way to get the {page_url} to work in the login form?

  • Did you end up figuring this out, Sean?
    – Alex Kendrick
    Commented Nov 21, 2013 at 16:38
  • Yes - when I can access that site, I'll look at the code and post it here as an answer. Forgot about this.
    – CreateSean
    Commented Nov 21, 2013 at 17:08

3 Answers 3


Use the Structure global variable {structure:page:uri} which is the same as EE's native "page_url" variable.

  • 1
    tried that still getting the same error and broken url
    – CreateSean
    Commented Nov 5, 2013 at 12:53

Sounds like it's just not parsing your {page_url} -- try parse="inward"?

{exp:member:login_form return="{page_url}" parse="inward"}
  • no change when adding parse="inward"
    – CreateSean
    Commented Nov 5, 2013 at 12:54

Try using EE's {current_url} Standard Global Variable. I've successfully used this for the return parameter on the Member module login_form tag for exactly the same scenario you are describing.

{exp:member:login_form return="{current_url}"}
  • Getting the same broken url... domain.com/%7Bcurrent_url%7D
    – CreateSean
    Commented Nov 7, 2013 at 1:10
  • Does {current_url} parse for you when output plainly in your template (ie, not as a module parameter)?
    – Alex Kendrick
    Commented Nov 7, 2013 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.