Request with %20
4 posts
• Page 1 of 1
- rmarcenaro
- Posts: 4
- Joined: 12 Apr 2012, 16:39
Request with %20
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.
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.
- rmarcenaro
- Posts: 4
- Joined: 12 Apr 2012, 16:39
Re: Request with %20
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]
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]
- rmarcenaro
- Posts: 4
- Joined: 12 Apr 2012, 16:39
Re: Request with %20
Well, only works with a single space in the request, with two or more, no longer works.
- rmarcenaro
- Posts: 4
- Joined: 12 Apr 2012, 16:39
Re: Request with %20
Now is solved!
final rule: RewriteRule ^([0-9]+)/([\w\s-]*)/$ /page.asp\?cid=$1&cdes=$2 [I,L]
final rule: RewriteRule ^([0-9]+)/([\w\s-]*)/$ /page.asp\?cid=$1&cdes=$2 [I,L]
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests