Request with %20

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 4
Joined: 12 Apr 2012, 16:39

Request with %20

12 Apr 2012, 16:45

I need help (i'm newer) dealing whitespaces in Request, an example:

Rule: RewriteRule ^([0-9]+)/([A-Za-z0-9]+)/$ /page.asp\?cid=$1&cdes=$2 [I,L]

Request: www.example.com/33/my%20category/

Translation expected: www.example.com/page.asp?cid=33&cdes=my%20category

In this case, does not resolve correctly, and I get error 404.

Thanks in advance, Rto.

User avatar
Posts: 4
Joined: 12 Apr 2012, 16:39

Re: Request with %20

12 Apr 2012, 17:03

Solved!

Well I just needed to read the documentation.

The final rule: RewriteRule ^([0-9]+)/([A-Za-z0-9[:space:]]+)/$ /page.asp\?cid=$1&cdes=$2 [I,L]

User avatar
Posts: 4
Joined: 12 Apr 2012, 16:39

Re: Request with %20

12 Apr 2012, 17:10

Well, only works with a single space in the request, with two or more, no longer works.

User avatar
Posts: 4
Joined: 12 Apr 2012, 16:39

Re: Request with %20

12 Apr 2012, 21:12

Now is solved!

final rule: RewriteRule ^([0-9]+)/([\w\s-]*)/$ /page.asp\?cid=$1&cdes=$2 [I,L]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 10 guests