Is a 404 or 301 Redirect Better?
Web sites often need to redirect users to a different page, either because a page no longer exists, an invalid URL was entered, or the filename of a page has been changed. Two common types of redirection are 404 and 301; read on to learn more about them and what kind of situation each redirect is better for.
404 redirects send the user to a single “catch-all” page which tells them that the webpage they are looking for does not exist. It can then link to the home page, allow visitors to search the web site, or provide a list of links for each section. It is not specific to the URL the user entered, and will show the same information regardless of whether the URL was incorrect or outdated. According to wikipedia.org, a 404 redirect page should be at least 513 bytes for compatibility with some versions of MSIE. Example:
ErrorDocument 404 /notfound.html
On the other hand, a 301 redirect forwards visitors going to a specific (former) webpage to a new page. If the user is sending form data to a PHP file, such as a search query, this data will be redirected to the new page as well. This can give users a more specific replacement for the invalid address they are trying to reach, increasing the chance that they will stay on the web site. Example, for a site where the search feature has been moved to a new subdomain:
Redirect 301 /find.php http://search.example.com/results.php
So which type of redirect is better for web sites to use? This depends upon the situation. If a webpage has been moved or combined with other pages, a 301 redirect is probably best. However, if pages have been deleted and there is no similar content on the web site, or users are just typing in the wrong URLs, a 404 redirect is better. Many sites can effectively make use of both 301 and 404 redirects.
When a page’s location is changed, both types of redirect are better than leaving duplicate pages in place. Search engines do not react favorably to multiple pages with identical content, and the web site operator receives the added burden of having to update both pages every time a change needs to be made.
Webpage redirection can be set up through cPanel (or a similar interface), or by adding/editing .htaccess files (via FTP or File Manager). Other types of automatic redirects exist as well, such as 302 and 307 (like 301, but “temporary”) and META refresh – which usually isn’t recommended, but is better than nothing if a hosting provider doesn’t allow other types.
No related posts.
