Solved: Solution for How to Redirect non www to www in NopCommerce | Web Hosting | Domain Registration | Wordpress Hosting | SSL Certificates

Solved: Solution for How to Redirect non www to www in NopCommerce

  
The easiest method is to update your web.config file inside the <system.webServer> node with...

 <rewrite>
          <rules>
              <rule name="Redirect to WWW" stopProcessing="true">
                  <match url=".*" />
                  <conditions>
                      <add input="{HTTP_HOST}" pattern="^yourdomainname.com$" />
                  </conditions>
                  <action type="Redirect" url="http://www.yourdomainname.com/{R:0}" redirectType="Permanent" />
              </rule>
          </rules>
      </rewrite>


This will keep your pages, URL parameters, links etc intact but redirect from NON-WWW to WWW of your domain name. It's also an SEO friendly method.
SHARE