Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Should I use 404 or 301 and 404 for error pages?

         

commo

12:38 am on Feb 12, 2015 (gmt 0)

10+ Year Member



Hi there,
I just joined in. I have a online shop, which about 6 months ago completely dropped out from SERP. Pretty much all my pages were in omitted results. It happened just in one day. My website is still doing well, but I trying to learn about SEO and fix many, many issues I believe my website had.

I am myself an IT guy, but never really learned about SEO. My website is developed using c# MVC.

Now to my question.
My default website redirects (301) to www. So lets say we have a domain aaa.com.au. That aaa.com.au is then redirected to www.aaa.com.au.
What would be proper behaviour for 404 pages? If someone types aaa.com.au/sadf (which does not exists) should it first redirect it to www.aaa.com.au/sadf and then throw 404 or should it just throw 404 without redirecting (301) to www?

I hope I am clear. Thanks!

not2easy

1:31 am on Feb 12, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi commo, welcome to the forums. Your canonical redirects (non www to www) should be handling all requests. The 404 is served when the requested URL does not exist so first the page needs to be requested which would happen as "www".

Sorry, but I couldn't tell from your question whether you are seeing this error or want to see it, but it should not be happening.

commo

1:38 am on Feb 12, 2015 (gmt 0)

10+ Year Member



Hi not2easy,
thanks for your reply. I can do it either way, but just need to know which one is correct. At the moment it works like that:

aaa.com.au/sadf returns a 301 (permanent) redirect
www.aaa.com.au/sadf returns a 404 not-found response

OR shoud it be just like this:
aaa.com.au/sadf returns a 404 not-found response

not2easy

2:15 am on Feb 12, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It is working the way it should be then. Returning a non www 404 for a www request is just wrong. I would not "fix" what is not broken.

commo

2:39 am on Feb 12, 2015 (gmt 0)

10+ Year Member



Thanks not2easy. Really appreciate your replies.

lucy24

4:50 am on Feb 12, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What may be puzzling you is this: Ordinarily, you don't want the 301-to-404 sequence. It means you're redirecting to a nonexistent page and then google starts yapping about Poor Technical Quality.

But in the specific case of domain-name-canonicalization, they're requesting a page that was never supposed to exist in the first place. So you haven't done anything wrong.

Ordinarily, the googlebot follows redirects almost immediately. (They don't have to, being a robot, but de facto they do.) The only exception is when they already know what's at the other end of the redirect. So if they just learned half an hour ago that b7hgfjkg.html doesn't exist, they won't request it all over again just because they got redirected to it.

Note that this only applies to vanilla 404s as issued by the server and/or CMS. If you're returning a 410 or (rare) manually coding for a 404, then this response will be sent out before the hostname gets canonicalized.