Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have a member restricted area, the page correctly shows the login form but the url doesn't change and the response is 200
How can i get it so a restricted page is redirected to /login with a 401 response?
Cheers Anthony
Try adding this to the top of your template:
@{Response.StatusCode = 401;}
Thanks but that appears to create a forever redirect loop
I made it work with a statement but not sure this is the best method?
if (!Request.Url.PathAndQuery.ToLower().Contains("login")) { Response.StatusCode = 401; }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Public Access restricted page returns 200
Hi,
I have a member restricted area, the page correctly shows the login form but the url doesn't change and the response is 200
How can i get it so a restricted page is redirected to /login with a 401 response?
Cheers Anthony
Try adding this to the top of your template:
Thanks but that appears to create a forever redirect loop
I made it work with a statement but not sure this is the best method?
if (!Request.Url.PathAndQuery.ToLower().Contains("login")) { Response.StatusCode = 401; }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.