Point www to http

Discussion in 'DNS/Domain names' started by whatfutureholds, Oct 23, 2015.

  1. How do I point www. to http on my domain?

    Having a user typing www. brings up my site, but that messes up facebook apps.

    I want www to automatically redirect to http

    Thanks
     
  2. When you say "http" do you mean the domain without "www"?

    By default the domain without www should bring up your site...
     
    Elshadriel likes this.
  3. Elshadriel

    Elshadriel Winhost Staff

    Then you need to add this URL Rewrite code to your web.config file:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="Redirect www to non-www">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^mysite\.com$" negate="true" />
                        </conditions>
                        <action type="Redirect" url="http://mysite.com/{R:1}" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    
    Replacing mysite.com with your domain name.
     
    Michael likes this.

Share This Page