How to redirect a link that has a colon: in it?

funny little problem.
i used to run some other cms here on that site, and some bot is trying to access an old link that has a colon in it.
now i can redirect links in site.yaml, but grav seems to choke on the colon.

redirects:
  /Blog/Here:_Not_here: /definitely-here

As soon as I remove the colon inside the link, the redirect works. But that doesn’t help because the bot doesn’t know it. According to this question yaml shouldn’t even care about it. Nevertheless I tried about all workarounds listed there, to no avail.
Is this a bug? Or is it fixable right now?

Another approach is to redirect at the webserver level. When using Apache you can use mod_rewrite to redirect the bot’s page request.

Use

redirects:
  "/Blog/Here:_Not_here": "/definitely-here"

otherwise the : in the URL is interpreted as a YAML separator

flaviocopes, it still 404s.
no other errors either, the debugger does not seem helpful on this, no logfile entry.
thing is, as soon as i remove the colon from the redirect definition, and try to access /Blog/Here_Not_here, it redirects to /definitely-here immediately!

bleutzinn, yes i think i might have to go the mod_rewrite way. maybe if the bot gets a useful response once it’ll leave me alone.

That’s going to be very difficult for Grav to handle to be honest. This is because colons are used in Grav for parameters. These are stripped off the URL first thing so the route will not contain the Here:_Not_here because the the Here param now has the value _Not_here.

Your best option is going to be at the web server level.