Forums/New Features

Login page redirection

Christopher Haupt
posted this on June 29, 2011, 17:58

Suppose you wanted to create a site with two kinds of content, perhaps retail marketing information that everyone can see and protected pages that only logged in dealers can see.

Today, if you were to provide a login link someplace for dealers, it would result in a less than ideal navigation path. When the dealer clicks on a login link and successfully authenticates, she would be routed back to the site's home page. She'd then have to potentially click again, presumably in some now visible navigational elements, to go to the "Dealer's Home Page".

The Webvanta authentication system's default behavior is to always redirect to the normal home page (/) when a visitor navigates to the /login page directly. When a visitor is presented with the /login page due to trying to directly visit admin level content, she is automatically redirected back to where she attempted to visit.

Now you can specify an alternative "next page" after a successful login for the first case. In your login page's form, add the hidden input element with the name "next_page" and the value of the URL of the desired landing page:

 <input type='hidden' name='next_page' value='/dealers' />