Copied to clipboard

Flag this post as spam?

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


  • Dmitriy 168 posts 588 karma points
    Aug 30, 2018 @ 16:26
    Dmitriy
    0

    UmbracoDomain does't works on localhost

    Hello.

    I trying to implement my custom IContentFinder to handle 404 errors like in this article but it depends of UmbracoDomain property of PublishedContentRequest.

    But it always return null when I run sollution on localhost.

    Here is my code:

     public bool TryFindContent(PublishedContentRequest contentRequest)
     {
          var domain = contentRequest.UmbracoDomain; // Always null =(
         // some other code...
    }
    

    How to make it work? Or alternative?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Aug 31, 2018 @ 06:12
    Dave Woestenborghs
    1

    Hi Dmitriy,

    To be able to use domains you will need to run on IIS. Than you can assign all your domains to the website in IIS. Don't forget to add them to your localhosts files.

    After that you need to assign the domains to your start nodes in Umbraco.

    Dave

  • Dmitriy 168 posts 588 karma points
    Aug 31, 2018 @ 08:01
    Dmitriy
    0

    To be able to use domains you will need to run on IIS.

    I run it on express version as always. Does it matters?

    Than you can assign all your domains to the website in IIS

    Can I make a fake local domain? How?

    Don't forget to add them to your localhosts files.

    What do you mean exactly? I am new with that things.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Aug 31, 2018 @ 08:06
    Dave Woestenborghs
    100

    I run it on express version as always. Is it matters?

    Don't know if you can assign multiple domains to a IIS Express website. Maybe this blog can help you out : https://abhijitjana.net/2011/08/05/multiple-url-binding-with-iis-express/

    Can I make a fake local domain

    Yes you can have for example site1.local and site2.local.

    What do you mean exactly? I am new with that things.

    You need to open up the file c:\windows\system32\drivers\etc\hosts

    In that file you can add this :

    127.0.0.1       site1.local
    
    127.0.0.1       site2.local
    

    Doing this will bind the domains to your own pc.

    Dave

  • Dmitriy 168 posts 588 karma points
    Aug 31, 2018 @ 08:43
    Dmitriy
    0

    Thanks, Dave, very helpfull :)

Please Sign in or register to post replies

Write your reply to:

Draft