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...
}
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.
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 ofUmbracoDomain
property ofPublishedContentRequest
.But it always return null when I run sollution on localhost.
Here is my code:
How to make it work? Or alternative?
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
I run it on express version as always. Does it matters?
Can I make a fake local domain? How?
What do you mean exactly? I am new with that things.
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/
Yes you can have for example site1.local and site2.local.
You need to open up the file c:\windows\system32\drivers\etc\hosts
In that file you can add this :
Doing this will bind the domains to your own pc.
Dave
Thanks, Dave, very helpfull :)
is working on a reply...