Forum Moderators: phranque

Message Too Old, No Replies

+ sign is showing up as space even with escape

+ sign is showing up as space even with escape

         

csdesign

2:29 am on Feb 4, 2009 (gmt 0)

10+ Year Member



could someone please help me out and try to point out what is exactly happening. i have an url redirect using mod rewrite and all other special characters are escaping except for "+" sign. any help would be greatly appreciated.

here is what i have:

RewriteRule ^items/([A-Za-z0-9\-.,/+=&#;¦]+)/?$ detail.php?id=$4 [NC,NS,L]

thanks

jdMorgan

2:39 am on Feb 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



May we please have an input, actual output, expected output example to clarify this?

Thanks,
Jim

csdesign

6:07 am on Feb 4, 2009 (gmt 0)

10+ Year Member



the current rewrite code gives me this url result (this is the item detail page):

[domain.com...]

however when "+" is in the variable (ie: ABC-123-00+) then the page url shows the "+" correctly (http://www.domain.com/items/ABC-123-00+) but the actual page sees the "+" as space instead of "+" so on the page, the item id will show up as "ABC-123-00 " and because of the space, the detail information about ABC-123-00+ wouldn't display the detail information about the item ABC-123-00+.

fyi, every other special characters only the "+" doesn't work.

please let me know if this explains the issue.

thanks

jdMorgan

2:18 pm on Feb 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This sounds like a problem with the script, and not with mod_rewrite. Again, I can't be sure, because I need to see the URL that you request with your browser, the filepath output from the mod_rewrite rule, and the filepath that you expected to be output by the mod_rewrite rule.

You can capture the actual output filepath in your script and print it on the page (as a test), or you can temporarily change your rule from internal rewrite to external redirect syntax, so that your browser will be redirected and show the rewritten URL in its address bar where you can examine it. The redirected URL will also show up in your raw server logs, where you can examine it more accurately, since the escaped characters will be shown as escaped characters (your browser will un-encode them before displaying the URL).

Jim