Reputation: 17761
When a request comes into my site without a trailing slash, e.g., /about
, I redirect to /about/
before serving any content. If a user requests a non-existant URL, they'll receive a 302 redirect before getting their 404. Our (very trustworthy) SEO team tells me that this confuses search engines, and that only having the 404 is key. I believe this, but I'm not totally sure I understand why. Can someone explain the technical reasoning?
Upvotes: 0
Views: 1992
Reputation: 507
You should serve 404 without any redirect, as if you are redirecting away from the page it's not the removed page that is returning a 404. I will give an example where this might cause problems.
So you have a page which you decide to remove that is indexed in Google. You remove the page and it now 302 redirects to a 404 page. However as a 302 redirect is a temporary redirect this removed page will stay in Google's results, as you are telling Google it's only temporarily moved. If the actual url returns a 404 page the page will over time drop out of Google's index.
Upvotes: 4
Reputation: 879
In order to complete moobot's good answer, Google doesn't like at all 302 redirections (redirect temporarily) ; it prefers 301 redirections (redirect permanently).
For SEO, there are two good ways to follow (as you wish, each choice is good):
1) redirecting bad url or old page to a personal 404 page
2) redirecting bad url or old page to the most pertinent page of your site
In any case, 302 redirections are bad pratices in SEO.
Upvotes: 0