Unpublished pages redirect 404 page

Vote:
 

Hi

we currently use a 302 redirect (at the iis server leve) to redirect unpublished pages to our 404mpage.

is there a way to do so so we won't use the redirect and the unpublished pages links will lead directly to our 404 page?

many thanks

E.

#197416
Oct 02, 2018 14:28
Vote:
 

You should have a look at the 404 Redirect Handler addon

You can catch 404s and redirect them. 

You can also setup (in Episerver) redirects from one URL to another and it should be able to do what you are looking for.

My only question - Why do you even have 302 redirects for unpublished pages? Unpublished pages will return 404 anyway...

#197608
Oct 09, 2018 6:59
Vote:
 

Hi Marcus

thanks for your answer, we use 302 redirect because if we use the unpublished pages we do not get 404 but we get the episerver login screen.

so we need to redirect all unpublished to our 404 pages.

our marketing guys says it is a bit problematic when google bot see the 302 before the 404.

many thanks

E.

#197621
Oct 09, 2018 9:00
Vote:
 

That is not the behaviour I am seeing.

If I create a new page and don't publish it, when I navigate to it (e.g. http://www.mysite.com/newpage) I get a 404.

If I publish it then I get a 200 and the page

If I expire it then I get a 404 again.

Are you sure that you are not trying to hit the unpublished page using the CMS link when you are not logged in (that would cause the behaviour you are seeing). The link would look something like http://www.mysite.com/EPiServer/Cms/#context=epi.cms.contentdata:///439&viewsetting=viewlanguage:///en  

#197622
Oct 09, 2018 9:11
This thread is locked and should be used for reference only.
* 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.