I want to redirect all my 404 errors to homepage


#1

How can I redirect all my 404 errors on Ghostpro to homepage?


#2

Hi there! If you’re having any issue with a Ghost(Pro) site, please drop us an email on support@ghost.org and we’ll be more than happy to give you a hand directly :slight_smile:


#3

You can add this to your error.hbs file to have it auto redirect using javascript:

<script>
    window.location.replace("/");
</script>

#4

I want it to redirect using 301 redirect.

Or

Can you give me a redirect code…

From https://prexblog.com/postname/feed

To

https://prexblog.com/postname


#5

You can check the redirects documentation here:

From there, I think the case that you need is:

{
    "from": "^\\/([A-Za-z0-9\\-]+)/@blog.url/rss/",
    "to": "/$1/"
},

You can replace /@blog.url/rss/ with /feed/ in your case.


#6

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