Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have an application using Umbraco 7.4.3
A new version of the code was compiled and release to production and I started to encounter strange behaviour with the front-end URLs.
Users have reported that sometimes the URL contains the IP address instead of the domain name. Re-publishing a page fixes the issue temporarily , from a user point of view. However, the logs show URL calls with the IP address are still being made and eventually a user encounters the behaviour again.
Even more strangely, other users do not experience the behaviour at the same time.
The logs show this all started when the new code was deployed.
I did not build the initial version of the application and cannot be sure the new version is an exact copy, plus my changes . Before I go comparing all the old code to the new code, does anybody know what may be causing the behaviour?
Have you checked the culture and hostnames in the backoffice?
Thanks for the reply Louis.
In "Culture and Hostnames" the Language is set to Inherit and no domains have been added.
I would probably go with what Kevin has said below however, if that does not fix the issue, then try adding your domain to the culture and hostnames and selecting the relevant language, as this might iron out any odd issues.
I'll look into this.
Please let me know if you have any other thoughts anytime.
Umbraco has an internal ApplicationURL it uses for a number of things, it gets this by taking the hostname from the very first request to the site.
it's possible that the first request after deployment is to the IP address version of the site?
you can force the value of this in the UmbracoSettings.Config file.
The old and new code have always had umbracoApplicationUrl set to the correct domain name.
I cannot find the IP address anywhere in the code, database, and IIS settings. It would appear it is being determined from the machine the site is sitting on.
Is there anywhere else Umbraco gets the hostname? Are there any settings, methods or objects I can search the code for?
I don't know if this makes any difference but, for extra information, this Umbraco solution is two websites. One sits inside our firewall and the other outside it. All changes are done on the internal website and are "published" to the external site. The external site is a carbon copy of the internal except for a few configuration settings relevant to the environment.
The internal site has never experienced the issue.
I'm not sure but I had a poke around the Umbraco Code (mainly looking at IUrlProviders) - all it really points to is the URL coming from two locations :
Thanks for looking. There doesn't appear to be any custom UrlProvider use or any other custom routing.
I'll have a look at the Assigned Domains and see what I can try there.
I've been scouring the logs to narrow down what leads to the issue but no success yet. I'll try to capture more next time the issue occurs.
If you have any other thoughts anytime then please let me know.
Kevin and Louis,
I have not been able to resolve the issue.
I haven't tried the hostnames option yet as I was reluctant to immediately start changing the configuration in the production environment. However, I am ready to investigate this option.
Before I do, please can you clarify the purpose and affects of adding hostnames. From my research, I understand that the feature is used when there are multiple websites on the same Umbraco instance.
Should it also be used if there are multiple domains names that point to a single website?
I have a redirect from another website and I am thinking that website's domain name should be added to hostnames.
domainname1.com - all pages behave normally.
domainname2.com (redirecting to domainname1.com) - domainname2.com is retained in the URL after the redirect.
Maybe adding domainname2.com to hostnames will resolve the issue???
How are you performing the redirect from domain2 to domain1?
There is an IIS "HTTP Redirect" on domain2 which targets a certain page on domain1.
"Redirect all requests to exact destination" is checked.
"Only redirect requests to content in this directory" isn't checked.
"Status Code" is set to "Permanent (301)"
So do you have an IIS binding on the site for domain2, if not i would try adding one
Adding the hostname is relatively safe, you will want to add the domain that is ultimately resolved so domainname1.com would be then hostname you would want to add, it essentially tells umbraco that the site you have is associated with that domain only (with regards to urls umbraco know about), so it will try to force urls to use that domain. So it might fix the issue you are having.
Im sure someone else may have a more educated or technical explanation but this is just my 2 cents from my experience with hostnames
I'll try to give this suggestion a go.
Richard Atkinson, have you set an A record for your 2nd domain ?
Not sure anybody has mentioned IIS bindings yet, but you can configure IIS to only respond to the domain name (i.e., if somebody did manage to request the site via IP address, it wouldn't work).
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted