Jay Walker
Jay Walker

Reputation: 4723

umbraco giving 404 on all pages except root. preview works fine

BACKGROUND

We are upgrading an umbraco 4.5.2 site running on Win2k8r2 / IIS7.5, SQL2k8r2 to umbraco 4.11.10. Given the number of steps required to perform the upgrade, we chose to do it offline and then replace production with the updated db and file system. We did an offline upgrade to bring it up to 4.11.10 (4.5.2 -> 4.6.1 -> 4.7.2 -> 4.8.1 -> 4.9.1 -> 4.11.10). These upgrades affected the database and the filesystem.

The old system has 14 domains resolving to the 1 umbraco site. The domains are just aliases and per requirements are not set up with redirects from 13 of the domains to a master - instead, each domain serves the same content - just with a different host. The 14 host headers are defined in IIS. They are also defined in umbraco under:

Content   (folder)
    EN    (language folder)
        Home   (Hostnames are defined here)
        Top Level 1 (also a child of EN)
        Top Level 2 (also a child of EN)

PROBLEM

When we test under localhost (which is defined in IIS but not as a hostname in umbraco), the site renders content as expected. However, when we test with one of the hosts defined in IIS and in umbraco host names (after setting it up to resolve to 127.0.0.1 in hosts file), we are able to get to the home page but all other pages result in a 404.

The home page and preview pages render fine and the content editor and other backend admin features work fine. However, the "nice url" pages do not render and get 404 errors.

WHAT I'VE TRIED

Is it necessary to do a clean install of 4.11.10 to install prerequisites that I may be missing? If so, what are these prerequisites and can they be installed independent of 4.11.10 install?

I'm at a loss as to what might be causing the issue. Any help would be appreciated.

Upvotes: 1

Views: 2569

Answers (2)

Jay Walker
Jay Walker

Reputation: 4723

A combination of items fixed the problem.

  1. The main problem was having the hostnames defined in umbraco under the Home node. I removed the hostnames defined in umbraco at the Host node. Hostnames still exist in IIS.
  2. In config\umbracoSettings.config
    1. Set <useDomainPrefixes> to false
    2. Set <addTrailingSlash> to false
  3. In web.config set umbracoUseDirectoryUrls to true
  4. Finally, fix a side-effect of removing the umbraco hostnames that causes requests for / to resolve to the EN node by adding the following to config\UrlRewriting.config

 <add name="SiteRootHack"
      virtualUrl="^~/$"
      rewriteUrlParameter="ExcludeFromClientQueryString"
      destinationUrl="~/home.aspx"
      ignoreCase="true" /> 

Upvotes: 2

Digbyswift
Digbyswift

Reputation: 10410

There are several things you should check, but if you are getting Umbraco's 404 page and you can access the backoffice then that is a good sign at least!

The first thing to do is check Umbraco's logs at ~/app_data/logs/ to see what Umbraco is logging upon each request, if anything. Then check:

  • Have you installed MVC3 and 4 on the server?
  • Is the application running in a .Net 4 integrated app pool?
  • Have you applied "write" permissions to the correct folders?
  • Try removing any domain settings you have in the Umbraco backoffice, these are almost redundant if the site is a basic install.

If possible you should also create an Umbraco project from NuGet, this way everything you need with regards to DLLs dependencies are installed in the project. Also, there shouldn't be any need to upgrade in so many steps. It should be possible to upgrade from 4.5 to 4.7 then to 4.11 directly.

Finally, check the breaking changes in the Umbraco versions. For example, GetProperty("propertyName").Value returns a string in one version and then was changed to object in a latter version possibly 4.11, so this would obviously start causing NullReference exceptions which may be inadvertently be causing the 404's. It is unlikely you would be able to upgrade like this without having to make some code changes.

Upvotes: 0

Related Questions