Try our conversational search powered by Generative AI!

Stop an unpublished page going to login page



I've got a page with the page stop property set to expired. When I visit this page as a logged out visitor, I get redirected to the login page, where, when you log in, you can then view the page.

What I'd like to do is instead point the user to the 404 page. Is there a way I can do this? Do I need to inherit something to override where it's redirecting to?

Thanks for any help!



Jul 07, 2010 16:11

I belive you can override method AccessDenied from any template (or your own base class for your templates).


Jul 07, 2010 16:24

Wow excellent! Problem solved!

Thanks very much Per!



Jul 07, 2010 17:01

Karl, I would also suggest that you instead of the 404 point the user to a 410 page. This way, the unpublished page will disappear much faster from search engines! 404 is not a bad choice though.

Jul 08, 2010 4:25

Really? I didn't know that! I'll look into that too, thanks Henrik.

Jul 08, 2010 9:52

Well, maybe I should clarify that so that it doesn't get any unwanted outcomes, cause you might actually want to use a 404 if that matches what you or your client wants.

A 410 will work as a more permanent and immediate 404 for search engines. If you serve a 404 the search bot will continue to visit that url for a while to ensure that it is really gone. A 410 will trigger an immediate removal of the page as you explicitly stated that it is gone.

So if there is a chance that pages will be re-published maybe a 410 is a bit harsh :)

Read more about this at

Jul 08, 2010 23:15
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.