homepage Welcome to WebmasterWorld Guest from 54.242.190.171
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
htaccess rewrite encoded url
vero

5+ Year Member



 
Msg#: 4153020 posted 4:36 pm on Jun 15, 2010 (gmt 0)

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!

 

jdMorgan

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



 
Msg#: 4153020 posted 2:00 am on Jun 16, 2010 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved