Apache .htaccess: How to rewrite backslash with slash on Firefox?

Surprisingly, that seems to be correct behavior. Backslashes are not amongst the characters allowed in a HTTP or HTTPS URL (as per RFC 1738 ), therefore they should be escaped. Note that the RFC explicitly mentions backslash as an unsafe character: Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters.

These characters are "{", "}", "|", "\", "^", "~", "", "", and "` All unsafe characters must always be encoded within a URL In other words, Firefox is doing the correct thing, even if it breaks pages which are incorrectly using backslashes (mostly from confusing URL syntax with Windows path syntax). Other browsers are trying to read the page author's mind, and they convert the backslashes to forward slashes before sending the request; whether this is a Good Thing is a matter of opinion Did you try to match on the escaped version of the backslash %5C?

Surprisingly, that seems to be correct behavior. Backslashes are not amongst the characters allowed in a HTTP or HTTPS URL (as per RFC 1738), therefore they should be escaped. Note that the RFC explicitly mentions backslash as an unsafe character: Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters.

These characters are "{", "}", "|", "\", "^", "~", "", "", and "`". All unsafe characters must always be encoded within a URL. In other words, Firefox is doing the correct thing, even if it breaks pages which are incorrectly using backslashes (mostly from confusing URL syntax with Windows path syntax).

Other browsers are trying to read the page author's mind, and they convert the backslashes to forward slashes before sending the request; whether this is a Good Thing is a matter of opinion. Did you try to match on the escaped version of the backslash - %5C?

As for the opinion - I think trying to guess the author's intent is doomed to failure (see the quirks mode minefield in the last decade, created by such attempts at mind reading). If the URL is badly broken, the browser shouldn't try to "fix" it - it should break instead of reinforcing the author's habit of writing bad code. Fixing it for the author leads to "eh, works for me".

– Piskvor Feb 3 at 16:32 Thanks for replay! But RewriteCond %{REQUEST_URI} (.*)%5c(.*)$ does not solve it either. Just Firefox for google.com/intl/en\about.html will return 404 error page, other browsers'll return google.com/intl/en/about.htm – Binyamin Feb 3 at 16:58 @Binyamin: Yes, and it always will, because FF is actually sending the backslash, whereas others will replace it with a slash; the rewrite should happen at your server (not at Google's), it won't fix this behavior on all servers.

Also, do you have the NC argument (case insensitive matching)? – Piskvor Feb 3 at 17:04 Unfortunately it does not work with NC either. Some other advice how to rewrite backslash with slash on FF!?

– Binyamin Feb 3 at 10:32.

It is Apache and FF bug, https://issues.apache. Org/bugzilla/show_bug. Cgi?

Id=35256 Hopefully it'll be fixed in soon feature. AllowEncodedSlashes should really be "on" by default and probably even deprecated. ... Nowhere the RFCs is a backslash (\) listed as a reserved character.

Therefore a %5C should always be decoded the same as %7E is converted to a tilde (~). To solve it on Apache: add AllowEncodedSlashes On in VirtualHost httpd-vhosts. Conf or httpd.

Conf, and . Htaccess: RewriteEngine On RewriteCond %{REQUEST_URI} ^(.*)\\(.*)$ RewriteRule . * %1/%2 R=301,NC,L.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions