I have a single Umbraco 7 instance that has 2 root nodes. One node points to stage.sctflash.com and the other node points to stage.bullydog.com. When I navigate to http://stage.bullydog.com/Products/accessories/podmount, the Request.Url.Host is stage.bullydog.com. Now, if I open up another tab and go to http://stage.sctflash.com/Products/accessories/podmount, the Request.Url.Host might be stage.sctflash.com, but sometimes, it just changes to stage.sctflash.com.
The one strange thing I noticed is that if I view the accessories node in Umbraco, I noticed the parent of it is stage.bullydog.com no matter if I am on stage.sctflash.com or stage.bullydog.com
I am using Request.Url.Host to determine as a query parameter to a database. I am basically getting the brand like this:
Since I just need to get the name of the root node. Is there a better way to do this without using Request.Url.Host? If I can get the name of the root node, this would work fine too?
The reason why accessing another website was bringing back the one websites content and the Request.Url.Host had the other websites information was because I had declared OutPutCache[Duration=60] at the top of my controller. If I waited 60 seconds and then refreshed, the correct data for each website would return. Once I removed this from the controller, everything worked as expected.
Request.Url.Host returns wrong host for template?
I have a single
Umbraco 7 instance that has 2 root nodes. One node points tostage.sctflash.comand the other node points tostage.bullydog.com. When I navigate tohttp://stage.bullydog.com/Products/accessories/podmount, theRequest.Url.Host is stage.bullydog.com. Now, if I open up another tab and go tohttp://stage.sctflash.com/Products/accessories/podmount, theRequest.Url.Host might be stage.sctflash.com, but sometimes, it just changes to stage.sctflash.com.The one strange thing I noticed is that if I view the accessories node in Umbraco, I noticed the
parent of it is stage.bullydog.comno matter if I am onstage.sctflash.com or stage.bullydog.comI am using
Request.Url.Hostto determine as a query parameter to a database. I am basically getting the brand like this:So essentially if
Request.Url.Hostis intermittently wrong, I get the wrong query parameter.To see this in action, if you go to
http://stage.sctflash.com/Products/accessories/podmount, you will see an SCT logo, then go tohttp://stage.bullydog.com/Products/accessories/podmountand you will see a Bully Dog logo. These logos are driven byRequest.Url.Host. If you refreshhttp://stage.sctflash.com/Products/accessories/podmount, you most likely will see theBully Doglogo now becauseRequest.Url.Hostis nowstage.bullydog.cominstead ofstage.sctflash.comSince I just need to get the name of the root node. Is there a better way to do this without using Request.Url.Host? If I can get the name of the root node, this would work fine too?
Hi Saied
Manish
The reason why accessing another website was bringing back the one websites content and the
Request.Url.Hosthad the other websites information was because I had declaredOutPutCache[Duration=60]at the top of my controller. If I waited 60 seconds and then refreshed, the correct data for each website would return. Once I removed this from the controller, everything worked as expected.is working on a reply...
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.