We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37272
    • 216 Posts
    Hi,

    I’m ditching my multi-level site structure because deep URLs can downgrade rankings with the search engines - well, with Google at least. What problems can I expect if I have some aliases repeated, and is there some easy way to ensure that I have no repeated aliases?

    Thanks.
      • 22303 MODX Staff
      • 10,725 Posts
      You can expect only one of the pages with that alias to work, probably the one with the lowest id. To find duplicate aliases you can run a simple query against your site_content table:

      SELECT alias, COUNT(id) AS dupes FROM modx_site_content GROUP BY alias HAVING dupes > 1


      Similarly, you can then find all of the id’s of those duplicated aliases by doing something like this:

      SELECT id, alias FROM modx_site_content WHERE alias IN (SELECT alias FROM modx_site_content GROUP BY alias HAVING COUNT(id) > 1)


      A plugin to customize what happens when you turn off that system setting (or perhaps just a simple module script to fix the issue) would be a really cool project for a would-be contributor. You could check for duplicates and then execute custom code to resolve the dupes by concatenating the original path names using the parents, or some other algorithm to make them unique.
        • 37272
        • 216 Posts
        Thanks OpenGeek,

        I’ll give it a twirl! smiley
          • 37272
          • 216 Posts
          You know, thinking about it, I’ll probably have to stick to using Friendly Alias Path. I am soon adding space for members to use, and with the expansion of webpages that will take place, all the obvious and useful page names will be eaten up - and page names that I may require at some future point in time, no doubt. What would be really useful is the ability to have two sections: one with Friendly Alias Path turned on, and the other where it is turned off. This way I can be sure of keeping all useful names open at the top level and have a single level for URLs, and members will be able to repeat useful and obvious pages names within their own section. Has anyone done anything like this?

          The number of pages I have is fairly limited at the moment, so I’ll just keep using FAP turned on and move the pages to the top level. This might become a real pain though as the number of pages increases. Anyone fancy coding this split FAP approach?

          Thanks.