I am trying to use the built-in UrlRewriting.config file to perform some rewrites. I've started with trying to rewrite to a category query string. The destination url I'm wanting/needing in this example is /my-blog?category=Category+1
The problem is when the query string is Server.UrlEncode(d) and it contains a space. (i.e. Category 1) is encoded to Category+1.
The url I was trying to rewrite from is /my-blog/category/Category+1 ... but this returns 404 error... Yet /my-blog/category/Category%201 works with the rule below. I like the + in place of the spaces like Server.UrlEncode is doing as oppose to the %20.
Any ideas why /my-blog/category/Category+1 doesn't work with the rule below?
UrlRewriting.net with Encoded query string
Hi all,
I am trying to use the built-in UrlRewriting.config file to perform some rewrites. I've started with trying to rewrite to a category query string. The destination url I'm wanting/needing in this example is /my-blog?category=Category+1
The problem is when the query string is Server.UrlEncode(d) and it contains a space. (i.e. Category 1) is encoded to Category+1.
The url I was trying to rewrite from is /my-blog/category/Category+1 ... but this returns 404 error... Yet /my-blog/category/Category%201 works with the rule below. I like the + in place of the spaces like Server.UrlEncode is doing as oppose to the %20.
Any ideas why /my-blog/category/Category+1 doesn't work with the rule below?
Here is the rewrite rule.
<add name="Categories Query"
redirect="None"
redirectMode="Permanent"
virtualUrl="^~/my-blog/category/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/my-blog?category=$1"
ignoreCase="true"
/>
umbraco 4.8.0
Windows Server 2008 R2 Standard / IIS7
Thanks,
Trent Brazeal
is working on a reply...