410 gives 404

#20270
  • Resolved Jakke Lehtonen
    Rank Math free

    Hi,

    If I have 410 redirection at Redirection Manager I’ll get 410 header just fine. But if I’m using conf-file of virtual host (Apache2) or .htaccess I’ll get 404 header – and just can’t figure out what I’m doing wrong now. Any ideas?

    BTW, maybe it would a good idea to tell in docs that imported htaccess must be before redirects of WordPress 😉 If redirects by Rank Math are after, those don’t work.

    Cheers, Jakke

Viewing 8 replies - 1 through 8 (of 8 total)
  • I’ve narrowed possibilites now. Redirection Manager works just fine. There is something in Apache2. So this can mark as solved but I’m a bit selfish now 😉 and will keep this open little bit longer if someone knows something-

    And… this is a support case anyway 😉

    The given syntax in htaccess-backup-file doesn’t work.

    Now it is:
    RewriteRule ^foo/bar [R=410,L]

    And it should be:
    RewriteRule ^foo/bar – [R=410,L]

    Yes, I can fix it quite fast using search&replace by myself but I would be nice if it will be fixed at some point 😉

    And now we are back in offtopic…

    I have a custom 410 error page because ordinary 404 is so unfriendly. Using it means a bot get 302 header because redirect 410 sets location (url of custom error page). Do you know if it breaks 410 or is is just sonething that happends?

    Anyway, I mark this as resolved.

    “I would be nice if”

    It would be nice if…

    Hello,

    Thank you for contacting Rank Math today.

    I am glad that you have been able to resolve this. I have passed on these findings to our dev team and we will be getting back to you in a short while.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Now it is:
    RewriteRule ^foo/bar [R=410,L]

    And it should be:
    RewriteRule ^foo/bar – [R=410,L]

    I don’t think, this is the right syntax. There is no need of – in the Redirection rule in htaccess: https://blog.templatetoaster.com/wordpress-htaccess-file-guide/#redirect-urls-htaccess

    Is it not working on your site without a - in the Redirection rule?

    Looking forward to helping you. Thank you.

    • This reply was modified 4 years, 4 months ago by Pratik.

    Really? It doesn’t matter what you think. Only that matters is the syntax 😉

    First, that links hasn’t a word about 410 gone redirection.
    Second, by Apache the hyphen must be used

    https://httpd.apache.org/docs/2.4/rewrite/flags.html

    I’ll make this much simplier
    – without the hyphen (by Rank Math) 410 Gone doesn’t work, but gives 404 not found
    – with the hyphen 410 Gone does work

    I’m really looking forward to see your explanation of that 😉

    • This reply was modified 4 years, 4 months ago by Jakke Lehtonen. Reason: typo

    Hello,

    I consulted our Development Team and it looks like the hyphen is needed in the 410 Redirection.

    We’ll further debug this issue and release an update soon with this fix.

    In the meantime, if there is anything else, please let us know.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this ticket.