Stop an unpublished page going to login page

Vote:
 

Hi!

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!

Cheers,

Karl.

#41455
Jul 07, 2010 16:11
Vote:
 

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

 

#41457
Jul 07, 2010 16:24
Vote:
 

Wow excellent! Problem solved!

Thanks very much Per!

Cheers,

Karl.

#41460
Jul 07, 2010 17:01
Vote:
 

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.

#41465
Jul 08, 2010 4:25
Vote:
 

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

#41473
Jul 08, 2010 9:52
Vote:
 

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 http://www.google.com/support/forum/p/Webmasters/thread?tid=1bc5206b5e0fac47&hl=en

#41510
Jul 08, 2010 23:15