Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • colouredfunk 2 posts 71 karma points notactivated
    May 28, 2017 @ 23:32
    colouredfunk
    0

    redirecting www to non www

    hello, I urgently need to get redirect www to just https://website.com however nothing I have tried in the web.config seems to be working, I just get a 404

    https://our.umbraco.org/forum/using/ui-questions/5411-Primary-domain-in-Umbraco?p=0#comment19750

    or

    http://egeek.io/redirect-www-to-non-www-iis/

    I'm not sure if I'm adding them in the correct place or it is something else.

    IIS 7 is installed although I don't have route access

  • colouredfunk 2 posts 71 karma points notactivated
    May 29, 2017 @ 00:29
    colouredfunk
    0

    OK I found the correct place for the add name rewrites ( in urlrewritting.config)

    However I can't remove the www

       <add name="SEOfix"  virtualUrl="http://www.website.co.uk/" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="https://website.co.uk/" redirect="Domain" redirectMode="Permanent" ignoreCase="true" /> 
    

    Does not work

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Jun 09, 2017 @ 23:32
    Alex Skrypnyk
    0

    Hi colouredfunk

    Did you solve your issue? Do you have some questions?

    Alex

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    May 29, 2017 @ 12:41
    Alex Skrypnyk
    0

    Hi

    Try this one:

    <add name="nonWWW"
                    redirectMode="Permanent"
                    redirect="Domain"
                    ignoreCase="true"
                    rewriteUrlParameter="IncludeQueryStringForRewrite"
                    virtualUrl="http://www.domainname.co.uk/(.*)" 
                    destinationUrl="http://domainname.co.uk/$1" 
                     />
    
  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    May 29, 2017 @ 12:47
    Alex Skrypnyk
    102

    Or just use rewrite rules:

    <rewrite>
      <rules>
        <rule name="Redirect WWW to non-WWW" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^domainname\.com$" negate="true" />
          </conditions>
          <action type="Redirect" url="https://domainname.com/{R:1}" />
        </rule>
      </rules>
    </rewrite>
    
  • Marcio Goularte 389 posts 1362 karma points
    Jun 10, 2017 @ 18:16
    Marcio Goularte
    2

    I recommend using rewrite rules. urlrewritting causes various performance issues

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Jun 10, 2017 @ 19:16
    Alex Skrypnyk
    1

    Hi Marcio

    You are absolutely right, that's why URLRewriting was removed from Umbraco since version 7.6. But it still works for some old instances.

    Thanks,

    Alex

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Continue discussion

Please Sign in or register to post replies