Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

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
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.


Featured Threads

Hot Threads This Week

Hot Threads This Month