HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Login redirect question

Login / Search

 [ Join | More ]
 Add topic 
#103283 (In Topic #20225)


Is there a way to automatically redirect users directly to a specific URL after they log in to my website?

Any help is always appreciated and thank you in advance,


Last edit: by Local Mc
Back to the top
Item has a rating of 5 (Liked by Local McLiked by Chris Graham)  

Community saint

I haven't tested this, so I'm not sure if this will work. You might be able to add a hidden form <input> line to the HTML login forms. I haven't checked all of the templates, but the two main templates for user logins would be BLOCK_SIDE_PERSONAL_STATS_NO.tpl and LOGIN_SCREEN.tpl. Adding something like this:


<input name="redirect" type="hidden" value="">

inside the HTML <form> in those templates just might work. Just change the part to be the URL to page you want members to be redirected to. You can probably omit the ?redirected=1 from the URL.

Be sure to add the new <input> near the bottom of the form, probably just above the </form> line. Keeping it near the bottom of the form should ensure it overrides any redirect parameter that gets inserted by ocPortal higher up in the form, as is the case with the LOGIN_SCREEN.tpl.  

Using the template editor for your theme in your site Admin Zone should allow you to make the edits without compromising the original files. Just be aware that any future bug fixes, updates, or upgrades to ocPortal or any addon related to logins (like the Facebook integration addon) could include changes or additions to the original templates. These changes or additions may be necessary to complete a login. Without them, that could cause your logins to become broken until you either integrate those changes into your override or you integrate your change (the added <input> line) into the new original templates.
Back to the top
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: