0

I was having old url like http://mydomain/blog/posts/2015/february/fill-and-follow/

and new url now is like http://mydomain/blog/posts/fill-and-follow/

So, for above scenario I want to write re-write rule. I am using rule as follows in UrlRewriting.config.

<add name="urlRedirect1"
 virtualUrl= "http://mydomain/blog/posts(.*)"
 rewriteUrlParameter="ExcludeFromClientQueryString"
 destinationUrl="http://mydomain/blog/posts/$1/"
 ignoreCase="true"
 redirect="Application"
 redirectMode="Permanent" /> 

What will be the actual rule?

ghetal
  • 403
  • 2
  • 11
  • 30

1 Answers1

0

solved the above.

the correct answer is as below.

<add name="BlogRewrite"
virtualUrl="http://mydomain/blog/posts/(.*)/(.*)/(.*)/$"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="http://mydomain/blog/posts/$3/"
redirect="Domain"
redirectMode="Permanent"
ignoreCase="true" />
ghetal
  • 403
  • 2
  • 11
  • 30