1

I want to redirect a request in an asp.net web site based on the domain, my scenario is like this.

I have the app setup so that it will process the requests from multiple domains like from www.abc.com and www.xyz.com, now i want that when ever a request comes to the www.abc.com/default.aspx the url would be rewrites to the www.abc.com/custom/abcdefault.aspx while for all the other requests like for www.xyz.com/default.aspx it should do nothing.

I am currently using the UrlRewritingNet.UrlRewriter for the URL rewriting,

Thanks,

asifch
  • 312
  • 4
  • 15

1 Answers1

3

try something along this:

<add name=”Redirect_abc.com”  virtualUrl=”^http\://www.abc.com/default.aspx”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”http://www.xyz.com/custom/abc.default.aspx″
redirect=”Domain”
redirectMode=”Permanent”
ignoreCase=”true” />

This just matches the pattern you specified before but can easily be changed to match another patetrn.

Regards

Jonathan

Jonathan Stanton
  • 2,531
  • 1
  • 28
  • 35