I need to return a url from a rewrite rule which contains either a hex value or an actual apostrophe.
I have tried escaping the apostrophe, returning the hex value, tried html entity name, entity value, tried using the B and/or NE apache rewrite rule flags… with no success
Random list of codes/values that I have been pulling from: http://www.obkb.com/dcljr/chars.html
The resulting url returns the entire url how ever where the apostrophe should be is simply displayed a 7 ( hex value from %27 ). this happens when I escape the apostrophe, or escape the hex value.
I am sure this is going to be a simple answer however there is not an obvious answer that I have found from the last couple hours of searching…
RewriteRule ^/accommodation/sx(.*)(-bedroom(.*))?$ http://www.myurlwithanappostropheinit.com/thispage.aspx?s=Stringwith+apostrophe\'s+are+here [NC,R=301,L]
— I have removed the B and NE flags from this example…
Found the solution, simple as expected.
%27 = ‘ ( apostrophe ) Hex value
Apache2 NE Flag — No escape
Rewrites as expected.