Plus sign getting replaced by spaces while permanent-redirect !!!

22 views
Skip to first unread message

Rohit Kumar

unread,
Oct 21, 2008, 12:39:28 AM10/21/08
to UrlRewrite, Rakshith B C, rohit...@toostep.com
I have a rule set where a URL

http://somedomain.com/community/a/1/b/t/Financial+Services/Investment+Banking
has to be redirected to a different URL.

<rule>
<from>^/community/([0-9A-Za-z_-]+)/([0-9]+)/b/t/([^/|.]+)/([^/|.]
+)/?$</from>
<to type="permanent-redirect">http://somedomain.com/community/a/
relevance/b/t/$3/$4/q/$1/$2</to>
</rule>

Where the values are mapped as following....

$1 = a
$2 = 1
$3 = Financial+Services
$4 = Investment+Banking

Expected URL :

http://somedomain.com/community/a/relevance/b/t/Financial+Services/Investment+Banking/q/a/1

Actual redirected URL is :
http://somedomain.com/community/a/relevance/b/t/Financial Services/
Investment Banking/q/a/1

where all the + (plus sign) are converted to spaces. How do i avoid
this? I want these redirected URLs to retain the + (plus sign).

Please suggest. Its become a blocker for my production as the link
sharing has completely broken because of spaces in URLs.



sunil

unread,
Oct 21, 2008, 4:27:01 AM10/21/08
to UrlRewrite
Can you try <to encode="true">....
I didn't try this, but guess this should fix the problem.

- Sunil

On Oct 21, 9:39 am, Rohit Kumar <niru.ro...@gmail.com> wrote:
> I have a rule set where a URL
>
> http://somedomain.com/community/a/1/b/t/Financial+Services/Investment...
>  has to be redirected to a different URL.
>
>     <rule>
>         <from>^/community/([0-9A-Za-z_-]+)/([0-9]+)/b/t/([^/|.]+)/([^/|.]
> +)/?$</from>
>        <to type="permanent-redirect">http://somedomain.com/community/a/
> relevance/b/t/$3/$4/q/$1/$2</to>
>     </rule>
>
> Where the values are mapped as following....
>
> $1 = a
> $2 = 1
> $3 = Financial+Services
> $4 = Investment+Banking
>
> Expected URL :
>
> http://somedomain.com/community/a/relevance/b/t/Financial+Services/In...

Rohit Kumar

unread,
Oct 21, 2008, 5:59:35 AM10/21/08
to UrlRewrite
I tried using <to encode="true" type="permanent-redirect" ... The +
(plus sign) gets encoded as %20.
How can I retain the + (plus sign) in the redirected URL?

Thanks,
Rohit

sunil

unread,
Nov 5, 2008, 11:00:45 PM11/5/08
to UrlRewrite
Didn't try this, but guess this could help:
<urlrewrite decode-using="null">. This should disable the filter from
decoding the URL, which means the '+' sign will not change to space.
Additionally, you might want to revert back <to> to encode="false".
NOTE: This change will disable decoding for all rules.

- Sunil

WILLIAMer

unread,
Dec 4, 2009, 12:57:54 AM12/4/09
to urlre...@googlegroups.com

Is there anybody solve question?
I got the same problem that plus sign became space.
So, i cant get the complete value from request.
Because the plus sign replaced by space.

--
View this message in context: http://old.nabble.com/Plus-sign-getting-replaced-by-spaces-while-permanent-redirect-%21%21%21-tp20083333p26635774.html
Sent from the UrlRewrite mailing list archive at Nabble.com.

Reply all
Reply to author
Forward
0 new messages