RikWare
...

Redirect domain names using UrlRewrite.NET

Tuesday, 30 October 2007 16:43 by admin

UrlRewriter.NET is a great tool for url rewriting in .NET. It can even be used to redirect domain names with.

e.g. RikPVR's main address is http://www.rikpvr.com/, but it can also be found at http://www.rikdvr.com/,http://rikdvr.com/ or http://rikpvr.com/ but ideally these should just redirect to the primary address. Using a host condition in UrlRewriter.NET makes this easy:


<if header="HOST" match="^((www.rikdvr.com)|(rikdvr.com)|(rikpvr.com))$">
<redirect name="RikDVR" url="^(.*)$" to="http://www.rikpvr.com$1" />
</if>
Categories:   General
Actions:   E-mail | del.icio.us | Permalink | Comments (6) | Comment RSSRSS comment feed

Comments

October 10. 2008 07:19

marco

Thanks for the tip. You saved me a lot of time.

marco

October 13. 2008 23:19

Abraham Luna

This code isn't working. I enter domain.com and get redirected to domain.com/www.desireddomain.com/Default.aspx

Abraham Luna

July 11. 2009 05:28

Scott Hugh Alexandar Petersen

Det er også fordi det skal gøres således Smile

<add name="DomainRedirect"
virtualUrl="^http://domain(.*)$"
destinationUrl="http://www.domain$1"
redirectMode="Permanent"
rewriteUrlParameter="ExcludeFromClientQueryString"
rewrite="Domain"
redirect="Domain"
ignoreCase="true"
/>
[/code]

Scott Hugh Alexandar Petersen

April 19. 2010 04:26

Morris

Interesting blog , not like the others!

Morris

April 19. 2010 12:02

us

I really love this particular blog very much. It is incredibly informative and surprisingly well done.Thanks a lot for it.And anyway I suggest you to check my web page too if you want.The summertime is coming and we get the top fitflop online shop of the cyberspace.We are experts in fit flops and very experienced. Best wishes once again for your website.

us

April 20. 2010 02:27

Steven

I have read several of the articles on this website today, and I sincerely love your technique of writing. I bookmarked it and will be checking back soon.

Steven

Comments are closed