Custom Error and page not found responses
-
When there is a 500 Internal Server Error, is it better to return an HTTP 500 response and custom error page from the requested URL, or is it better to return a 302 redirect? The redirect would send the browser to the custom error page, which would return the HTTP 500 result.
We tell Google not to index or follow our error pages, so if Google sees an error at a URL, we don't necessarily want Google to think that the URL should be ignored. That's why the alternative would be to redirect to a custom error page with it's own URL.
Similarly, what's the best approach if the response is a 404? Return HTTP 404 and custom 404 page from the requested URL, or redirect?
Thanks.
-
Just to add to Ryan's comments - if you had massive 500 issues, then you might theoretically argue that 301'ing would keep Google from crawling so many errors. At best, though, it's a band-aid, and maybe even a poor-fitting one. The better question is - why are those 500s occurring. Ultimately, they should be fixed, not patched.
Usually, Google isn't going to penalize a one-time 500 error or a short-term server problem. The only time I could see 301'ing is if you knew you had a major problem and couldn't fix it for a few days. The 301 (or possibly 302, in this case) could buffer you from crawl problems while you made the fixes. Obviously, that wouldn't be an ideal situation.
-
I have often though about this but have never really come to a answer.
If you 301 or 302 a page to a 404 error page and then return a 404, what are you telling the search engine. are you telling them that the erorr page does not exist, not the origianl page.I have always done just that, it was only recently that when wondering why goolge has not dropped pages from the index, that I had a good think about it. If you dont do anythiong and use the default ugly error page, it give a 404, rather than a 302 then a 404.
is this what gogole was talking about when they came up with soft 404 errors in WMT?
I did set up a test where i did both in 2 sites but i did not follow up on the test. -
The header response code chosen is important. I cannot think of any reason why you would choose to provide a 500 response code other then when your server naturally offers that response.
A 301 code should only be returned if you actually 301 the URL to the proper target. This code sends a message to search engines saying "hey, update the URL in your index to this new URL".
A 404 code should be returned if the content is no longer offered on your site and will not be offered. Actually, a 410 response "Gone" means the content is permanently gone and wont return. This tells search engines they should definitively remove the link. A 404 code tells search engines the content is not presently available. It may be a temporary issue which can later be resolved. When a search engine repeatedly finds a 404 error, they will then take action and remove the link.
-
Thanks for the replies.
I'm not sure I stated my question clearly. What I was wondering, was whether it is better to return status code 500 from the requested url, or status code 301 from the requested url. So in one case, the actual url content would be the error page, and in the other case it would redirect to the error page.
I'm not even sure if there is a difference, but if there is I'd like to learn more.
Thanks.
-
The best approach for a 404 error varies. If you know what the user was looking for and you have that content or similar content available, you should 301 redirect the user to the appropriate page on your site. For example, if you have a page on "Top 10 Christmas Gifts for 2010", if you delete that page you likely should perform a 301 redirect to your "Top 10 Christmas Gifts for 2011" page if it is available.
If you don't have a similar page available on your site, let the URL 404. Ensure your 404 page is helpful. It should have a basic "oh no, we lost your page" message along with your site's normal navigation and a search box. 404 errors are a natural part of the internet. In small numbers they are perfectly fine. Also, ensure your site's links are all valid. You can't control whether an external link leads to a 404 error but none of your internal links should cause a 404 error.
With respect to a 500 error, those are not common (at least compared to 404s). Something on your server is not configured correctly. You should have an error log and investigate the root cause of any 5xx errors. Find the source of the error and take action to fix it.
-
A 404 error means "not found". This is usually the page you get when you make a mistake spelling page name in a site, or if the page is deleted or moved. The problem is that the standard 404 page is ugly and unhelpful.
Many people have figured out that if you use a custom 404 page you can present a much more helpful page to you visitors. Others have taken it a step further and made that custom page a redirect to the home page, so that any links (and PR) pointing to pages that have been deleted (or misspelled) will be passed on to the website.
Hope this helps
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
If a page ranks in the wrong country and is redirected, does that problem pass to the new page?
Hi guys, I'm having a weird problem: A new multilingual site was launched about 2 months ago. It has correct hreflang tags and Geo targetting in GSC for every language version. We redirected some relevant pages (with good PA) from another website of our client's. It turned out that the pages were not ranking in the correct country markets (for example, the en-gb page ranking in the USA). The pages from our site seem to have the same problem. Do you think they inherited it due to the redirects? Is it possible that Google will sort things out over some time, given the fact that the new pages have correct hreflangs? Is there stuff we could do to help ranking in the correct country markets?
Intermediate & Advanced SEO | | ParisChildress1 -
Is this page low quality?
Hey everyone, I need some help defining a post whether it is low quality or not. I got a post and it's a roundup post having 5 lists of fonts for free download. I actually linked to the sites from where anyone can download the font. The post is driving 300 visits a day but the bounce rate is too high around 90% and the time spent on the post is about 20 seconds on average (I checked it under GA Behaviour > Site Content > Landing pages). Also, I checked the traffic of those sites which I'm pointing in the roundup post and in their referral traffic my website is contributing. Does this mean that people clicking on the post from SERPs then quickly visiting the site to download the font as there are only 6 fonts featured in the post to download (due to six font they are not spending time)? Should I need to improve it or the page is answering query fast? Any thoughts are welcome.
Intermediate & Advanced SEO | | Bunnypundir0 -
Wrong Pages Ranking
Good Afternoon We had an issue a while ago with the incorrect pages ranking in Google for some of our key terms. For example the page ranking for the term in Hotels in Spain was an individual information page for one particular hotel in Spain rather than the top level page which is optimised for "Hotels in Spain" The individual property page was ranking around 36-40 so we tightened up all the internal linking structure to ensure the term "Hotels in Spain" was pointing to the correct page and de-optimised the individual property page for the term. After a few weeks, everything seemed to be working and we were ranking top of second page for correct page however, ranking report today has reversed our good fortune and the incorrect page is ranking in a low position Any further suggestions or advise would be very much appreciated. Ideally, I don't want to remove the page that is ranking as it's still relevant for a search for that particular hotel
Intermediate & Advanced SEO | | Ham19790 -
Too many on page links
Hi I know previously it was recommended to stick to under 100 links on the page, but I've run a crawl and mine are over this now with 130+ How important is this now? I've read a few articles to say it's not as crucial as before. Thanks!
Intermediate & Advanced SEO | | BeckyKey1 -
Importance of minimal markup on a page
Moz.com's 2013 SEO study gave some value to "Total # of Characters in the HTML Code" (https://moz.com/search-ranking-factors/2013). Is having minimal HTML on a page still a ranking factor, even if not a huge one?
Intermediate & Advanced SEO | | A2890 -
Pages that 301 redirect to a 404
We are going through a website redesign that involves changing URL's for the pages on our site. Currently all our pages are in the format domain.com/example.html and we are moving to stip off the .html file extension so it would just be domain.com/example We have thousands of pages as the site deals with news so building a redirect for each individual page isn't really feasible. My plan is to have a generic rewrite rule that redirects any page that ends .html to the stripped off version of this. A problem I can see with this is that it will also redirect pages that don't exist. So for example, domain.com/non-existant-page.html would 301 to domain.com/non-existant-page which would then return a 404 status. What would the SEO repercussions be for this? Obviously if a page doesn't exist already then it shouldn't show up in the search engine indexes and shouldn't be a problem but I'm a bit worried about how old pages that currently legitimately 404 will be treated when they start to 301 redirect to a 404 instead. Not sure if there any other potential issues from this that I've missed either? Thanks!
Intermediate & Advanced SEO | | sbb0240 -
301 page into a 404
Hi I have a job board site and the way the site is built means that I cant 404 job pages once they have expired. To combat this Im looking to 301 the pages into a 404 page.Do any of you have any experience with this? Are there any potential pitfalls to doing a 404 this way? Thanks
Intermediate & Advanced SEO | | AndrewAkesson0 -
Duplicate page Content
There has been over 300 pages on our clients site with duplicate page content. Before we embark on a programming solution to this with canonical tags, our developers are requesting the list of originating sites/links/sources for these odd URLs. How can we find a list of the originating URLs? If you we can provide a list of originating sources, that would be helpful. For example, our the following pages are showing (as a sample) as duplicate content: www.crittenton.com/Video/View.aspx?id=87&VideoID=11 www.crittenton.com/Video/View.aspx?id=87&VideoID=12 www.crittenton.com/Video/View.aspx?id=87&VideoID=15 www.crittenton.com/Video/View.aspx?id=87&VideoID=2 "How did you get all those duplicate urls? I have tried to google the "contact us", "news", "video" pages. I didn't get all those duplicate pages. The page id=87 on the most of the duplicate pages are not supposed to be there. I was wondering how the visitors got to all those duplicate pages. Please advise." Note, the CMS does not create this type of hybrid URLs. We are as curious as you as to where/why/how these are being created. Thanks.
Intermediate & Advanced SEO | | dlemieux0