Welcome to WebmasterWorld Guest from 54.167.175.218

Forum Moderators: Ocean10000 & incrediBILL & phranque

htaccess rewrite encoded url

   
4:36 pm on Jun 15, 2010 (gmt 0)

5+ Year Member



I am wondering if htaccess can help me with this

Facebook is encoding the slashes and question marks after the query string of any link I add to it. So that
example.com?who/what?when
becomes
example.com?who%2Fwhat%3Fwhen
which returns a not found or error message when clicked in the browser

Is there a way htaccess could be used to convert any "%2F" in a url back to a slash "/"
and any "%3F" in a url back to a question mark "?"

I've only used htaccess for redirects, so... be kind.
Thanks you!
2:00 am on Jun 16, 2010 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yes, encoding of those characters is required by the HTTP protocol specification. Therefore, FaceBook is "doing it right."

Correct your scripts to generate, require, and handle encoded characters as specified. See urldecode() in PHP.

We webmasters are not free to "use any old character anyplace we like" in hostnames, URL-paths, and the query strings appended to those URLs. See RFC2396 - Uniform Resource Identifiers (URI): Generic Syntax [faqs.org] for more information. Note that the 'rules' for encoding vary, based on the three URL-parts that I identified.

Unfortunately, changing your scripts is the fix.

Jim
 

Featured Threads

Hot Threads This Week

Hot Threads This Month