Redirecting a url containing a hollow square character
A link from a website beyond my control links to an erroneous url. The erron开发者_运维问答eous url contains a hollow square character. How do I write a redirect 301 to deal with this occurance? When attempting to paste the character in the .htaccess file I get a question mark.
If I need more than a redirect 301, then what?
The hollow square character isn't an actual character, but a set of unprintable bytes. It could be a virtually limitless set of values. What you should do instead is set up rule to say "If the character is not in this defined set, it is invalid"
RedirectMatch 301 !^([\w#!:.?+=&%@!\-\/])*$ http://myserver.com/desired/redirect/url
I haven't tested this, but it should work. If not let me know and I'll help revise it.
Solution: I used ​ in it's place and it worked. I got this by switching from chrome and opening the link in firefox. The ​ showed up in the 404 error description area.
精彩评论