DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Issue with friendly url

 12 Replies
 0 Subscribed to this topic
 13 Subscribed to this forum
Sort:
Page 1 of 212 > >>
Author
Messages
Growing Member
Posts: 27
Growing Member

    So, on some module we created in the past we generated a friendly url to a detailpage, kind of like this:

    string GetDetailLink(ItemInfo objItemInfo)
    {
        string detaillink = "";
        int tbid = TabId;
        string Path = "~/default.aspx?tabid=" + TabId + "&itmid=" + Convert.ToString(objItemInfo.ItemId);

        DotNetNuke.Entities.Tabs.TabInfo TabInfo = default(DotNetNuke.Entities.Tabs.TabInfo);
        DotNetNuke.Entities.Tabs.TabController TabController = new DotNetNuke.Entities.Tabs.TabController();

        //Retrieve the TabInfo object from the TabId
        TabInfo = TabController.GetTab(tbid, PortalId, true);
        detaillink = DotNetNuke.Common.Globals.FriendlyUrl(TabInfo, Path, CleanTitle(objItemInfo.ItemName));
        return detaillink;
    }

    So the link would look something like:

    www.website.com/pagename/itmid/123/name-of-the-item

    which worked nice.

    However I noticed the link is generated like this, but when I click on it the DNN Urlrewriter on only some DNN installations will take off the last part, so I end up with:

    www.website.com/pagename/itmid/123

    In the address bar.

    It looks like on some DNN installations it will keep the complete url, and on some installations it will remove the last part.
    And I wonder why, and what can be done about it.
    I've tried messing with the SEO settings but I can't figure it out.
    Perhaps someone knows?!!

    Growing Member
    Posts: 89
    Growing Member
      I noticed this on 1 installation, I upgraded DNN and it worked. So I just assumed it was a bug and did not investigate.
      Growing Member
      Posts: 86
      Growing Member
        Just a guess but I would look at the regex rules for SEO and see if they are different between sites that work or don’t work.

        I’m sure I will clobber some terminology, but the friendly url rewriter inherited with the forums module worked great but conflicts with the “advanced” friendly url provider in more recent DNN versions, and has been a constant source of frustration :)

        In some future version, I have hopes of an overhaul but in the meantime, I ended up resorting to a bit of underhanded trickery. During installation, Regex rule is added to say “get off my lawn”. You might want to try something similar for itmid=

        https://github.com/DNNCom...nityForums/pull/292/
        Growing Member
        Posts: 27
        Growing Member

          Well, I did compare all the regular expressions/settings on the SEO page in DNN, so I think this can not really be the issue.

          I also checked some different DNN versions, and as far as I can see it is not related to the DNN version.
          I tried on a DNN 9.9.X and it worked ok, and I tried on a DNN 9.13.3 and it worked ok.
          It did not work on a DNN 9.11.x version, so I upgraded that to DNN 9.13.4 but it still had the same issue, so I figured it must be some other configuration thing....

          That's why I thought, let's try the forum....but what you mentioned I already tried, kind of...

          So I think it must be something else..

          Growing Member
          Posts: 86
          Growing Member
            Did you compare friendly url section from web (dot) config?
            Growing Member
            Posts: 86
            Growing Member
              Also are you using iis url rewriter and if so, is it configured same on each site?
              Growing Member
              Posts: 27
              Growing Member

                Seems to be the same, so I have no clue what could be the setting/configuration which causes this behaviour.
                 

                Growing Member
                Posts: 89
                Growing Member
                  Do you have content localization turned on?

                  Is there anything in the "TabUrls" table? I sometimes have had strange URLs when that has been incorrectly updated.
                  Growing Member
                  Posts: 27
                  Growing Member
                    After A LOT of research, I found it.
                    When I finally looked in the tabsettings table of the old site, it looks like there is a setting with the name "DoNotRedirect" when I add it to the table for this tabid and set the value to True, the page will keep the last part of the url.
                    I can't seem to find a way to set this value from the UI (page settings), so I think this was removed at some point.
                    Since it actually HAS a function, I would suggest to the DNN people to add it back to the tab settings....


                    Growing Member
                    Posts: 27
                    Growing Member
                    • Accepted Answer
                    Added it to github:
                    https://github.com/dnnsof...Platform/issues/6130
                    Page 1 of 212 > >>

                    These Forums are dedicated to the discussion of DNN Platform.

                    For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                    1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                    2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                    3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                    4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                    5. No Flaming or Trolling.
                    6. No Profanity, Racism, or Prejudice.
                    7. Site Moderators have the final word on approving / removing a thread or post or comment.
                    8. English language posting only, please.

                    Would you like to help us?

                    Awesome! Simply post in the forums using the link below and we'll get you started.

                    Get Involved