Forum Moderators: coopster & phranque

Message Too Old, No Replies

In a url, how to turn %2520 into %20?

mod_rewrite needed

         

Archos

2:54 pm on Oct 5, 2006 (gmt 0)

10+ Year Member



If you feed Google Adwords with keywords, and provide Text Ads with the variable {KeyWord} in the Destination URL, the dynamic Destination URL will look like this:

www.site.com/{KeyWord}

Which result in something like this:

www.site.com/Key Word (variable is imported from the feeded keywords)

This works great if the space would be automatically replaced with %20, but it doesn't. This is how it shows up on the site:

www.site.com/Key%2520Word

I've seen mod_rewrite scripts that replace words after/before a slash, but is this also possible to replace like all %2520's with %20's?

Relevant topics:
- How to turn a space into %20? [webmasterworld.com]
- How to make this URL work? [webmasterworld.com]

tsalmark

3:39 pm on Oct 5, 2006 (gmt 0)

10+ Year Member



I have no idea where that is coming from but %2520 is a double encoded space space = %20 "%20" = %2520

Maybe you need to look at the flow of the URL from address bar to your logs, to try to figureout where it is being encoeded a second time.

jdMorgan

4:07 pm on Oct 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Archos,

Are these URLs that are requested as a result of Adwords clicks rewritten when they arrive at your server? -- In other words, do you internally rewrite or externally redirect these URLs?

If so, see the [NE] flag for RewriteRule, which is used to prevent escaping of 'special' characters, such as "%" in the RewriteRule substitution.

Normally, if a substitution URL contains a "%", that will be converted to %25, with the ASCII value of the following character appended, so %20 is escaped to %2520.

Jim