Redirect User from viewing page if not logged in.

Dcode warner asked on May 2, 2017 19:28

I'm using the 'LogOn Mini Form' webpart on a login page to allow someone to login and redirect them to an only members page. My next issue is redirection viewers who are not logged in to the page with Login page.

Bascially redirect anyone who is not logged - take them to the login page.

Correct Answer

Dcode warner answered on May 2, 2017 22:19

I think I got it. I used the random redirect code to check and compare the person who is viewing the site public or logged in.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Roman Hutnyk answered on May 2, 2017 19:58

I'm not sure I understood your issue. It sounds like you need redirect non authenticated user to a logon page.

If this is a case, secure pages, those require authentication, by going to page properties -> security and check Requires Authentication radio button at the bottom of the form.

Next step would be to let Kentico know what is your login page. Go to Settings -> Security & Authentication and specify logon page url @ Website logon page URL field.

Hope this help.

If this is not what you're looking for - please, provide more details.

4 votesVote for this answer Mark as a Correct answer

Dcode warner answered on May 2, 2017 21:14

@Roman Hutnyk Your correct. This is pretty much what I was asking. I'm trying to prevent the public from viewing a page where they need login access. In other words if they do not have already the login credentials to sign in and see the page I dont want anyone to see the page without FIRST loggin in. So I'm looking a redirect to force them to the login page if they try to access the login page. Same as going to an AOL page where you need to login to continue.

I tried following your steps but I have Kentico 7. Do this still applies? I don't see "Security & Authentication" I have "Security & membership" and the 'Authentication' option under that gives this message: "There are no settings in this category, please select some other category."

Let me know if this is any clearer?

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on May 2, 2017 21:20 (last edited on May 2, 2017 21:50)

Yes, it applies to v7.

Security & membership is the section you need - sorry for confusing you. Just click "Security & membership" and scroll down a little.

0 votesVote for this answer Mark as a Correct answer

Dcode warner answered on May 2, 2017 21:27

@Roman Hutnyk This is my screen. I don't think I have that area. http://prnt.sc/f3crzd and http://prnt.sc/f3cs6e

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on May 2, 2017 21:37

Don't you see Website logon page URL field on the first screenshot?

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on May 3, 2017 21:39

You have to select the menu item Security & Membership in your screen shot, and there will be a section called Content, that has a logon page URL. Documentation

0 votesVote for this answer Mark as a Correct answer

Dcode warner answered on May 10, 2017 17:39

How can I redirect secure links to a specified page on the front end. Basically I have a registration web part on page which requires the user to login or sign up in order to view the file. Right now if I go to the secure link (https) it ask me to log into the Kentico backend. Which I do not want.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.