Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a "404 redirect" a legitimate redirect?

I have a situation where some users may come to mistyped pages, from links, etc. In most situations I can determine the correct page that should be displayed, so I want to redirect to the correct URL.

Is a 301 Redirect appropriate in this case. 301 means "Moved Permanently", but in this case the document wasn't there in the first place. Is it legitimate to set a 404 Not Found header, then redirect to the correct URL?

like image 335
DisgruntledGoat Avatar asked Nov 30 '22 11:11

DisgruntledGoat


1 Answers

Beware of 301, as it means "permanently", e.g. even if you use that URL in the future, search engines might want to disregard it - as they "know" the content at that particular URL was moved "permanently".

Use 303 See Other if you want the redirect, or - better - display 404 and a friendly error-message that links to the preferred content.

like image 124
ty812 Avatar answered Dec 04 '22 12:12

ty812