November Happy Hour will be moved to Thursday December 5th.

404 is redirected with a 302

Vote:
 

Hey all

We have taken over an old episerver 6.2 project at work that I'm currently doing some SEO optimizing on. And I want to redirect with a 301 to the 404 page when a page is not found. Currently the solution redirects with a 302 like so:

We have tried making a custom 301 redirect but that will only handle the second 301 redirect to the 404 and not the first (sdgh <- a page that doesn't exist). which is the one google will look at.>

Is there any way to hook into the way episerver handles the first redirect for pages that doesn't exist?

Thanks in advance

Also I'm sure you will have an opinion to how to handle redirects to a 404, but this is how we want to do it :)

#117920
Feb 24, 2015 10:32
Vote:
 

Hi,

Your image isn't working.

Please have a look this blog post http://dodavinkeln.se/post/how-to-create-an-editable-404-page on how to set up a 404 page. You also need to turn of EPiServer's global error handling.

<configuration>
	...
	<episerver>
		<applicationSettings globalErrorHandling="Off" />
	</episerver>
	...
</configuration>

This will not create a redirect at all, which is the preferred way. Or is there a specific reason why you want to have a redirect?

#117937
Feb 24, 2015 18:04
Vote:
 

That's weird. I can see the picture just fine.

What about this picture?

There is already set up a 404 page on the site. But not quite the way you do it in your link (thanks for that). I will try and edit my webconfig and add the <customerrors> under <system.web>

#117948
Feb 25, 2015 8:42
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.