Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ferdy Hoefakker 214 posts 248 karma points
    Jan 24, 2011 @ 15:15
    Ferdy Hoefakker
    0

    Subdomain underneath subdomain.

    Not sure how to properly explain this, but here goes. We have a client who has a website, I'll call the site corporateSite. Now, this is the current site structure:

    content (default umbraco content folder thiny)
    |_www.corporateSite.nl (set manage hostnames so the different URLS go to this node)
              |_page1
              |_page2
              |_Outlets
                   |_Outlet1
                   |_Outlet2

    Okay, now, Outlet1 is reachable under the URL of www.corporateSite.nl/Outlets/Outlet1. So far so good. But, our client is very specific about this, and demands that each outlet will also be reachable under it's own subdomain like: Outlet1.corporateSite.nl.

    In theory, this sounds easy, but I just can't manage it. I set the hostheader in IIS, I set the url in the Umbraco content section to that specific node. But I just keep on getting a pretty 404 page saying the page cannot be located. I already tried republushing the entire site as well which didn't help.

    Anyone else having anymore bright ideas or clues as to what I might be missing?

    Thanks in advance.

    -Ferdy

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jan 24, 2011 @ 19:06
    Sebastiaan Janssen
    0

    Have you tried NOT setting the hostname on the top node (Umbraco chooses the first node under "Content" by default)? So only set the hostnames on the outlet subdomains.

    If that fails, you might be able to get away with a urlRewrite rule instead of setting the hostnames from within umbraco.

  • Ferdy Hoefakker 214 posts 248 karma points
    Jan 24, 2011 @ 19:17
    Ferdy Hoefakker
    0

    Well, I just tried it, but I think to fully test it I need some more settings in the IIS (I undid some settings I think when it wasn't working so the live site wouldn't be botched for the rest of the evening), which I can't do from home at the moment. So I'll try first thing in the morning. Thanks for the suggestion Sebastiaan, I'll let you know how it goes :)

    -Ferdy

    Update:

    Okay, so it still didn't work, so I asked a colleague (he wasn't there yesterday) and he said it's quite simple. We currently do not have the domain name, so I can try as much as I want, if they don't point their subdomains to our servers, it's just not going to work.

    Will try again AFTER I can get a hold of the guy taking care of the domain name.

  • Ferdy Hoefakker 214 posts 248 karma points
    Jan 26, 2011 @ 13:44
    Ferdy Hoefakker
    0

    Okay it sortof works now. However, Umbraco says in the backend that the url of pages beneath the subdomain pages have a link of:

    Outlet1.corporateSite/pageName

    This is what I expect, however, when visiting this url, I get a 404. I already tried with and without setting hostnames to the corporateSite and I republished the individual nodes as well as using the replubish site function. Any other ideas or is rewriting the only option?

    -Ferdy

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jan 26, 2011 @ 14:01
    Sebastiaan Janssen
    0

    I've just tried in my local install of 4.6.1 and I get the same behaviour unfortunately, this doesn't seem to be implemented too well I'm afraid.

    So yeah, you're looking at a rewrite or a redirect of all of the subdomains to a page in the site.

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jan 26, 2011 @ 16:22
    Sebastiaan Janssen
    0

    Wait a minute, might have it working now:

    In your web.config set umbracoHideTopLevelNodeFromPath to true and in umbracoSettings.config set useDomainPrefixes to true. Does it work then? Works over here..

  • Ferdy Hoefakker 214 posts 248 karma points
    Jan 31, 2011 @ 15:16
    Ferdy Hoefakker
    0

    Sorry for the late reply, had a rather urgent thing I had to take care off causing me to sideline this project for a bit.

    Anyway. I'm afraid that's not the answer to my problem either Sebastiaan. I have also tried the url rewriting file that comes with umbraco, but that's not working either. Says the virtual path does not exist. Do I need to enable something specifically for that or something?

    -Ferdy

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jan 31, 2011 @ 16:59
    Sebastiaan Janssen
    1

    Alright, so I've tested this again:

    In IIS, I have added 2 domains to the bindings of my test site:

    - umb46.local
    - blog.local

    web.config: useDirectoryUrls = true (false also works!)
    umbracoSettings.config: addTrailingSlash = true (false also works) / useDomainPrefixes = false

    Content tree looks like this:

     

    Content
    test
    test2
    my blog
    test4

     

    In the "test" node, the hostname in umbraco is "umb46.local" 
    On the "my blog" node, the hostname in umbraco is "blog.local"

    The links on test4 look like this now: 

     

    Link to document 
    /my-blog/test4/

    Alternative Links
    http://umb46.local/my-blog/test4/
    http://blog.local/test4/

    They all work like they should. 
    What umbraco version are you using? This might've been fixed in a recent version.. I'm using the latest nightly of 4.6.1.

     

  • Mark Mitchell 35 posts 60 karma points
    Jan 31, 2011 @ 21:41
    Mark Mitchell
    0

    Just a quick tip I learned for when you are testing domain related things that are dependant on the domain name but you do not have access to the DNS settings. You can setup a test enviroment by adding the dns records you want to point at any ip you want into the hosts file lcoated at C:\windows\sytem32\drivers\etc (don't ask me why they put it there!).

    This way you can trick your computer into resolving any domain name you want into any IP address you need. Of course this will only affect your computer, so its only useful for testing/development on your local machine but its handy at times. Also don't forgot to delete the entry when you are done testing so that you can still resolve back to the correct public settings.

  • Ferdy Hoefakker 214 posts 248 karma points
    Feb 01, 2011 @ 09:06
    Ferdy Hoefakker
    0

    Okay, this is a step in the right direction! I currently have the following:

    Link to my document:
    /Outlets/Outlet1

    Alternative link:
    http://corporateSite.nl/Outlet/Outlet1
    outlet1.CorporateSite.nl

    All these links work and it's subpage also has the correct links (and they also work!). But, the automated XSLT menu will default to /Outlets/Outlet1. Which is not what I (or rather our client) wants. Do I have to solve this with rewriting? If yes, I have been playing around with the rewrite file, but no luck so far.

    As for your question Sebastiaan, I'm afraid that I'm still stuck on 4.0.3. In what little in between time that I have I am trying to update our XSLT's to 4.5's new schema so we can do a full update.

    -Ferdy

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 01, 2011 @ 09:34
    Sebastiaan Janssen
    1

    Alright, no need to upgrade, just checking! :-)

    So, almost there, you can use the GetCurrentDomains function to try and see if you can get the first found domain, this should be your outlet subdomain.

    I do understand, though, that you don't want: outlet1.corporatesite.nl/outlets/outlet1 but just outlet1.corporatesite.nl. Right? So maybe you should write a little XSLT extension that reconstructs the correct path for your specific situation. You can use the GetCurrentDomains function in your code as well to make it a bit easier.

     

  • Greg Mattison 40 posts 60 karma points
    Aug 16, 2013 @ 17:51
    Greg Mattison
    0

    Hi, we're having the same issue related to subdomain hostnames.  We tried the config changes above and still can't get the site to resolve at the hostname.

    We have a site running in the main content node at www.seal-krete.com which works fine.  We have another folder/node in the main content tree with a hostname setup as http://hp.seal-krete.com but it's giving the following error below.  The subdomain is setup in IIS and we can't figure out why it's not resolving.  If we preview pages in the subdomain node, we can see them but they resolve at the www domain with the numeric page id like /1852.aspx

    This is delaying launching the subdomain site so we need to resolve this ASAP.  Thank you for your help!

    Server Error

    404 - File or directory not found.

    The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Please Sign in or register to post replies

Write your reply to:

Draft