views:

27

answers:

2

A link from a website beyond my control links to an erroneous url. The erroneous 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?

A: 

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.

Wade Tandy
A: 

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.

Julian
While this solution will take care of this specific character, it probably won't cover all instances of a bad character, fyi.
Wade Tandy