Custom redirection and hosting 404

Need help to redirect the wrong URL for a file to correct file URL. Also, wrong URL throwing hosting 404 where we're expecting theme 404 template.

  • Adam Czajczyk
    • Support Gorilla

    Hello Tim

    That kind of redirect would require adding custom rules to nginx config file and restarting nginx as well each time. Making changes in nginx configuration is a bit risky and might affect a lot of other aspects of the site/server - as it's a managed hosting we're taking care of that.

    For now, if it comes to this kind of redirect we can manually add them for you, just let us know.

    As for other redirects, such as most of URL redirects (e.g. from some page to another page and similar) - those can be addressed using WordPress plugin such as e.g. this one:

    https://wordpress.org/plugins/redirection/

    Best regards,
    Adam

  • Tim
    • New Recruit

    Hi Adam Czajczyk ,

    Thanks that's clear. I actually closed this ticket but only part of my question was resolved.

    The redirect is working fine now but what about the error pages. If you open a file which no longer exists you are not getting the 404 page from wordPress but from you guys. Same with other errors like 403, 500, etc. How can we customize this?

    Thanks,
    Tim

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Tim ,

    Let me explain some things first so it's understandable and clear :slight_smile: .

    Let's take as an example an uploaded image. That image has 2 URLs within the WordPress environment.

    1) Would be the "attachment" link ( that is basically a post showing that image ). This is handled by WordPress so a plugin that adds 404 pages would show that.

    2) Would be the actual link to the file itself so something.com/wp-content/uploads/2019/07/images.jpg. This is handled by the server as it's a straight file link and it's not parsed at all by WordPress. This is why this would return a "server" 404 page.

    At the moment it's not customizable but I've pinged our Sysadmins about it and we'll have a talk internally to see how we can support this out of the box in the future :slight_smile: .

    For the time being if you have a custom 404.html that you want to show instead you can tell me and we can add a custom rule to your hosting environment to show that instead of the default 404.

    Regards,
    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.