Redirect HTTP 404 Errors to Index Page


#1

Hi all,

Been googling around and have yet to find the answer for my question, hopefully someone here will know the answer!

I’ve been trying to figure out how to get Ghost to redirect to the index page of the blog instead of loading the error.hbs 404 page.

I have tried setting this in the Nginx configuration however, no success with that, I presume because Nginx is just acting as a reverse proxy to the Ghost server.

Is there any configuration in Ghost itself that would allow me to redirect all HTTP 404 errors to the Index page?

I am currently running these versions of Ghost & Nginx:
Ghost-CLI version: 1.7.1
Ghost Version: 1.22.3
nginx version: nginx/1.10.3

Thanks,
Evan


#2

Hey @Wourell :wave: Ghost doesn’t have any option for doing this because it’s really bad for SEO.

Redirecting all 404s rather than serving a 404 response can generate a lot of duplicate content warnings and possibly penalties because the redirect tells search engines that the content on the old page is now available on a new page. If you’re redirecting all 404s to your homepage then search engines see every old URL as now having exactly the same content as your homepage.

If you have old links that no longer exist you have a few options:

  1. redirect that URL to the new location of the content (teaches search engines that the new page should be treated as the new canonical location). Ghost has a redirects feature for this if needed.
  2. create replacement content at the same URL (I’d try to keep the topic as close as possible to keep any search engine placement you had for that URL)
  3. modify the 404 page content to help direct visitors to relevant content or the homepage (probably still useful in addition to one of the above options)

#3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.