Copied to clipboard

Flag this post as spam?

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


  • Gökhan Öztürk 6 posts 76 karma points
    Feb 01, 2023 @ 11:45
    Gökhan Öztürk
    0

    How to remove www from url

    Hello,

    I am using version 11.1.0 How do I redirect urls with www to urls without www

    I want it to be www.domain.com >> domain.com. I searched a bit but couldn't find a solution. Thanks for your help.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Feb 01, 2023 @ 11:59
    Huw Reddick
    0

    you will need to use a url rewrite rule to do this, that is the job of your webserver not Umbraco. If you are using windows/IIS then ensure you have the IISrewrite module installed and add a rule to your web.config file

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Feb 02, 2023 @ 08:09
    Dave Woestenborghs
    0

    Hi Gohkan,

    You can also use the .NET core Url Rewriting Middleware : https://learn.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-7.0

    In the configure method in your Startup.cs add the following before app.UseUmbraco

     var options = new RewriteOptions();
     options.AddRedirectToNonWwwPermanent();
    
     app.UseRewriter(options);
    

    Dave

  • Gökhan Öztürk 6 posts 76 karma points
    Feb 03, 2023 @ 10:43
    Gökhan Öztürk
    0

    @Dave Thnks

Please Sign in or register to post replies

Write your reply to:

Draft