Musings
Public · Protected · Private
How to redirect nonWWW requests to WWW. requests
-
2012-07-18 11:08Typically when user goes to http://janaganamana.net/CountryXJgm.aspx instead of http://www.janaganamana.net/CountryXJgm.aspx the google map is not visible.-- reason - we registered GMap account to parent www.janaganamana.net... In view of that we wanted to redirect all such requests of http://janaganamana.net/somepage* to http://www.janaganamana.net/somepage* This is how you do .... <system.webServer> <!--defaultDocument ................/--> <rewrite> <rules> <rule name="SomeNameForThisRule" enabled="true" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^[^\.]+\.[^\.]+$" /> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" /> </rule> </rules> </rewrite> </system.webServer>
This blog is frozen. No new comments or edits allowed.