Using mod rewrite to redirect non-www URL to www URL on IIS

[et_pb_section bb_built=”1″][et_pb_row][et_pb_column type=”4_4″][et_pb_text]

How we used Helicon ISAPI Rewrite 3 to redirect URLS without www to the correct www URL on IIS 7.5

Without some form of mod rewrite installed you need to create an additional site in IIS and redirect using an ASP or HTML file in the folder that the site points to, which results in twice as many sites to maintain in IIS Manager.

We have used Helicon Rewrite 3 for some time to provide friendly URLs in our SSIDM content managements system, and also use it for solving the non-www URL problem, using the script below:-

[/et_pb_text][et_pb_dmb_code_snippet _builder_version=”3.0.106″ style=”default” linenums=”off” usetabwidth=”off”]IyBIZWxpY29uIElTQVBJX1Jld3JpdGUgY29uZmlndXJhdGlvbiBmaWxlClJld3JpdGVFbmdpbmUgb24KUmV3cml0ZUNvbmQgJXtIVFRQX0hPU1R9ICFed3d3XC4uKgpSZXdyaXRlQ29uZCAle0hUVFBfSE9TVH0gIV4kClJld3JpdGVDb25kICV7SFRUUF9IT1NUfSBeKFteLl0qKVwuKGNvbXxvcmd8bmV0KQpSZXdyaXRlUnVsZSBeLiokIGh0dHA6Ly93d3cuJTEuJTIle1JFUVVFU1RfVVJJfSBbUj1wZXJtYW5lbnQsTF0KUmV3cml0ZUNvbmQgJXtIVFRQX0hPU1R9IF4oW14uXSopXC4oY29cLnVrKQpSZXdyaXRlUnVsZSBeLiokIGh0dHA6Ly93d3cuJTEuJTIle1JFUVVFU1RfVVJJfSBbUj1wZXJtYW5lbnQsTF0KUmV3cml0ZUNvbmQgJXtIVFRQX0hPU1R9IF4oW14uXSopXC4ob3JnXC51aykKUmV3cml0ZVJ1bGUgXi4qJCBodHRwOi8vd3d3LiUxLiUyJXtSRVFVRVNUX1VSSX0gW1I9cGVybWFuZW50LExdClJld3JpdGVDb25kICV7SFRUUF9IT1NUfSBeKFteLl0qKVwuKGx0ZFwudWspClJld3JpdGVSdWxlIF4uKiQgaHR0cDovL3d3dy4lMS4lMiV7UkVRVUVTVF9VUkl9IFtSPXBlcm1hbmVudCxMXQ==[/et_pb_dmb_code_snippet][/et_pb_column][/et_pb_row][/et_pb_section]