Copied to clipboard

Flag this post as spam?

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


  • Jonas Eriksson 930 posts 1825 karma points
    Aug 12, 2009 @ 21:18
    Jonas Eriksson
    0

    Change site root node, NiceUrl doesnt change

    I have this kind of node structure:

    content

    - top

    - - subcontent1

    - - - example page 1

    - - subcontent2

    - - - folders and pages

    First I had the top-node as the root of the entire site, so the example page 1 was on the url : www.mydomain.com/subcontent1/example-page-1

    Now I like to skip subcontent2 and move the root downto subcontent1, so the url to example page 1 is : www.mydomain.com/example-page-1

    I tried to accomplish this by right-clicking top-node and "manage hostnames" and remove the domain from there. And then I did the same at subcontent1-node and add'ed the domain there instead. Afterwards I republished entire content and all pages.

    Now, strange enough the site listens to both url's (both my example url's works). Thats ok, but umbraco.library:NiceUrl(@id) produces the old url, which I do not like. What can be wrong here?

     

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 12, 2009 @ 23:21
    Peter Dijksterhuis
    0

    You could try to edit the umbracoSettings.config (in the config-folder) and set useDomainPrefixes to true.

    Remember to also touch the web.config and then republish. I think that might do the trick.

    HTH,

    Peter

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 09:16
    Jonas Eriksson
    0

    Hi, thanks for your suggestion. It was not it however. When I tried that I got a 404 on each contentpage I tried to open (the startpage was visible though):

    No umbraco document matches the url 'http://www.mydomain.com/example-page-1'

    umbraco tried this to match it using this xpath query'/domainprefixes-are-used-so-i-do-not-work')

    It's very stubborn on this. Have I missed something obvious here?

    (I found when I set back the useDomainPrefixes to false again, to get my contentpages work at all, I did not need to touch web.config nor did I have to republish.)

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 09:18
    Jonas Eriksson
    0

    I'll perhaps try to get my nose down into that NiceUrl source to track this further.

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 10:10
    Jonas Eriksson
    0

    I'm starting to wonder if I am one level to deep for my site root? Are site roots only allowed one level below content root?

  • Chris Koiak 700 posts 2626 karma points
    Aug 13, 2009 @ 10:28
    Chris Koiak
    0

    Do you have different hostnames on subcontent1 and subcontent2? This combined with Peter's suggestion should work.

    content
    - top
    - - subcontent1
    - - - example page 1
    - - subcontent2
    - - - folders and pages

    If you don't have hostnames set at that level then you'll get into difficulties removing the 'subcontent' level as the child pages may not ne uniquely named.

    Example

    content
    - top
    - - subcontent1
    - - - example page 1
    - - subcontent2
    - - - example page 1
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Aug 13, 2009 @ 12:28
    Douglas Robar
    0

    Remember that when you change the hostnames, use directory urls, or any setting that requires umbraco to update the url for a node... you must re-publish the affected page(s).

    In this case, it is not simply the 'republish site', which is very fast and only updates the server's memory. Rather, you must right-click on each top-level content node and select the 'Publish' menu. Be sure to select the 'publish all children' option. If you've got lots of content this will take a few moments to complete as umbraco is recalculating urls and updating various things.

    Then, when you look on the Properties tab of a content node you'll see the updated url reflected.

    Does this resolve the issue?

    cheers,
    doug.

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 13:17
    Jonas Eriksson
    0

    Hi, thanks for your input, I did that before, now I try again:

    1) change useDomainPrefixes to true

    2) republish each level 1 node with sub pages

    but I still get the 404-msg "No umbraco document matches the url ..." (when I fire up a page from the properties page Alternative links)...

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 15:03
    Jonas Eriksson
    0

    Did anything happen between v. 4.0.1 and 4.0.2.1 on this? I am still on 4.0.1 on this site.

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 15:41
    Jonas Eriksson
    0

    I think I just let this rest for a while to keep the little piece of sanity I evetually still have :-) I laborated with changed hostnames, publish and republish, deleted Lucene index-files, deleted xml-cache, recycled application pool, restarted web server. Nothing I did changed the NiceUrl-function so that it got rid of the old root node name in the path.

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 15:59
  • Jonas Eriksson 930 posts 1825 karma points
    Aug 13, 2009 @ 16:22
    Jonas Eriksson
    0

    Note to self : have a look in the Codeplex Issue Tracker when something looks odd:

    neehouse wrote Feb 13 at 11:13 AM
    NiceUrl needs several modifications.

    1.) Hostname as mentioned in this issue.
    2.) Domains assigned at levels > 2. (url generateds, but does not resolve correctly)
    3.) Domains in url when on same domain - not necessary (opinion)
    4.) Relative Url output to RawUrl (new feature)
    5.) Custom extensions or trailing slash directory urls.

    http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=19818

Please Sign in or register to post replies

Write your reply to:

Draft