0

I am having a problem with my Umbraco installation on IIS. The site is working, apart from my home button. When I push the home button, the URL should be

http:/myserver.mysite

instead the URL is

http:/myserver

When I type in the link it serves me the home page but when I click on the Home button it wont and the scenario described above occurs.

I am using IIS 7 and Umbraco 6.1.1.

Hassan Ata Ullah
  • 347
  • 1
  • 2
  • 16

2 Answers2

1

Did you set your hostname in Umbraco?

Right click on the site root in your solution and click "Culture and hostnames"

enter image description here

Fill out your hostnames and save

enter image description here

Eric Herlitz
  • 25,354
  • 27
  • 113
  • 157
  • haven't tried your solution but i m gonna give it a try when i m working on it again. Right now we have reached the deadline for this project and I got it working with URL rewrite. Yor solution seems much easier then url rewrite if it works :) – Hassan Ata Ullah Jul 05 '13 at 12:58
1

If you are able to get to the homepage with both hostnames but then clicking on the Home link takes you to the second host, the link in the page must be referencing the hostname directly. If this is the case, check your HTML to ensure that the hostname isn't present in the link - basic I know but you have to check.

If it isn't, contrary to what Eric Herlitz says in his answer, I would ensure that you don't have anything set in the hostnames options. I only use the hostnames option when I need to control the hostnames of multiple root nodes. Umbraco will automatically assume that the first node in the tree is the default site. In other words, if you have two sites at the root of your Umbraco instance but only one hostname bound in IIS, Umbraco will serve the first of the branches as the default site, unless as Eric Herlitz states, you have specified the hostnames for specific nodes.

Instead, I would use the settings in IIS to ensure that requests are routed to the correct hostname. I know using Eric's approach is possibly easier, but it would undoubtedly mean that users will still be able to reach and browse the site using both hostnames. Ultimately from an SEO perspective this is a bad thing. Personally, I would ensure that any requests to anything but your preferred hostname are redirected to you hostname whilst retaining the path. This can be done via IIS using the UrlRewrite 2 module.

If you don't have access to this, you can use MVC routing (see here for an explanation) or the UrlRewriting module that comes shipped with Umbraco. With the latter, settings are specified in the ~/config/UrlRewriting.config file and documentation can be found here: http://www.urlrewriting.net/149/en/home.html

I would personally recommend familiarising yourself with all these techniques as they can be quite powerful.

Digbyswift
  • 10,310
  • 4
  • 38
  • 66
  • Thanks for the answers. I used Url rewriting module to point to the right address and it worked but not sure if that is the right thing to do. – Hassan Ata Ullah Jul 05 '13 at 12:51
  • There's absolutely nothing wrong with that. It's only a question of managing the URL. Personally I like using a bespoke, 2-column CSV file containing 'from' and 'to' values and a HttpModule that caches it on first use but also uses it as a cache dependency. So if it changes the cache is updated. – Digbyswift Jul 05 '13 at 13:29