We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4704
    • 22 Posts
    I’ve just noticed an issue with the way that FURLs are being displayed. Right now I’m just testing out MODx before putting it into production on our corporate website, so I’ll need to figure this out before I can get approval.

    I have a directory heirarchy that looks like this:

    h-solutions
    - ds
    - mh
    --- mhs
    --- mhc
    ----- industry-name
    --- mhs2
    - vpsh
    - ch
    - cc

    I’m seeing inconsistent friendly URLs depending on which page I visit. For example, when I click "Preview" for "h-solutions -> ds" it takes me to the correct location at domain.com/h-solutions/ds.html. Preview for "h-solutions -> mh -> mhs" correctly takes me to domain.com/h-solutions/mh/mhs.html. Preview for "h-solutions -> mh -> mhc" correctly takes me to domain.com/h-solutions/mh/mhc" however preview for "h-solutions -> mh -> mhc -> industry-name" incorrectly takes me to domain.com/industry-name.html. It’s missing the h-solutions/mh/mhc/ part of the URL. The incorrect URL does indeed show the contents correctly though.

    Most other URLs work correctly. At first I thought the problem was because of how far down the heirarchy the industry-name is and I also thought it was only happening to this one URL, but I also get the same problem with h-solutions -> msh2 (and others) which takes me to domain.com/msh2.html instead of domain.com/h-solutions/msh2.html.

    Has anyone experienced this before or have any suggestions?

    FURL settings:
    allow_duplicate_alias : yes
    automatic_alias : yes
    friendly_alias_urls : yes
    friendly_urls : yes
    use_alias_path : yes

    I have also tried without automatic_alias and without allow_duplicate_alias but witht he same results.

    Oh, and for my .htaccess file
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    I would appreciate any help or suggestions.
      • 4704
      • 22 Posts
      I should also point out that I have cleared my cache multiple times.

      I have also just added the "industry-name2" to the structure:

      h-solutions
      - ds
      - mh
      --- mhs
      --- mhc
      ----- industry-name
      ----- industry-name2
      --- mhs2
      - vpsh
      - ch
      - cc

      So newly-added domain.com/h-solutions/mh/mhc/industry-name2.html URL works correctly, but for industry-name I get domain.com/industry-name.html
        • 4704
        • 22 Posts
        I’m still unable to determine the cause of this problem or a fix for it. Has anyone else experienced this problem before or have any suggestions?
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          What happens if you try to visit the URL as it would be expected? What does [[~5]] output, where 5 is the ID of the industry-name resource? What is the value of the "parent" column for that resource when looking in the database?

          This is the first time I’ve heard about a problem like this, so am just shooting questions at you that might reveal where a problem should be found..
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 4704
            • 22 Posts
            Hi Mark,

            Thanks so much for the reply. I was starting to feel awfully lonely out here wink

            When I go to the URL that I expect (domain.com/h-solutions/mh/mhc/industry-name.html) I get the 404 page.

            When I output [[~36]], which is "industry-name", it outputs industry-name.html which is incorrect. When I output [[~37]], which is "industry-name2", I get the correct h-solutions/mh/mhc/industry-name2.html.

            The value in the "parent" column for resource 36 (industry-name) in MySQL is 34, which is correct. Similarly, the value for the parent column for resource 37 (industry-name2) is also 34.

            Please keep in mind that this isn’t just happening to the one resource, it’s occurring with at least 2 or 3 that I’ve seen so far - same symptoms. This was a brand-new install and all I’ve done up to this point is set up FURLs and proceeded to create the resource hierarchy for about 20 pages. No real contents in them or anything yet.

            If you or anyone else can offer any additional suggestions or places to look I would be grateful.

            Thanks
            Cass
              • 18373 ☆ A M B ☆
              • 3,141 Posts
              Can you check out the core/cache/web/context.cache.php file? Find the aliasMap or aliasListing part of the array (around line 430/660 for me, but it depends on the number of resource you got).

              What’s the (revelant) entries there for those two resources?


              When checked that, try clearing the cache and see if it’s been regenerated the same..


              If the aliasMap and aliasListing give the wrong entries, and it’s been regenerated in the same fashion that would indicate something is going wrong when generating that...
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • 4704
                • 22 Posts
                Wow, you’re quick smiley

                I think you’re on to something here. Here’s the relevant settings in core/cache/web/context.cache.php

                For aliasMap:
                ’industry-name.html’ => ’36’,
                ’h-solutions/mh/mhc/industry-name-2.html’ => ’37’

                For aliasListing
                ’industry-name.html’ => ’36’,
                ’h-solutions/mh/mhc/industry-name-2.html’ => ’37’

                I also noticed that it is exactly 3 resources that are doing this, all in different "sub sections". Two are just regular "html" and one is a "folder".

                After clearing the cache, going to a page then checking the core/cache/web/context.cache.php file again, I do end up with the exact same results in the file. So I guess the question is, what’s causing it to generate that way. Do you think I may need to dive into the modx source code?
                  • 18373 ☆ A M B ☆
                  • 3,141 Posts
                  Blame the notify option and Outlook being open for my speed, lol.

                  I’m afraid I don’t know (from the top of my head anyway) where the aliasMap and aliasListing is being generated, but I’ll give this topic a shout out on Twitter and see if I can find it or if somebody else has ideas this evening wink
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • 32070
                    • 87 Posts
                    @cass

                    What type of system is this install running on (e.g. PHP ver, Webserver, LAMP, WAMP ??) That might helps us figure some of this out....

                    It’s weird that the industry-2 resource is aliasing correctly..... hmmmm.

                      Des
                      webandflowdesign.com
                      • 18373 ☆ A M B ☆
                      • 3,141 Posts
                      Just another thought. What happens if you duplicate the resource that is acting up? How does that resource behave when it comes to FURLS?
                        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.