We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28522
    • 29 Posts
    Greetings,
    I have a general curiosity about ModX. I have a client who INSISTS on keeping their current URL structure hierarchy for the sake of SEO but wants me to redesign the entire site. Essentially, there’s just 8 languages and each folder just contains un-nested subpages. For example, the English site is kept in a directory called English and each page is based off of English/page.html and etc... with no sub-folders. I turned off friendly site path alias or whatever it’s called so that every page in ModX is site.com/alias.php but is there any way in ModX i can add in that ENGLISH directory to a group’s URL’s and a SPANISH one for another site and still be able to have the loose page structure for the containing pages?

    Thanks in advance for any advice! Anyone have experience with redesigning a site that’s well placed on Google and changed all the URL’s?
      • 26931
      • 2,314 Posts
      Hi there,

      i think you just need to enable "Use friendly alias path"

      cheers, j
        • 22303 MODX Staff
        • 10,725 Posts
        Can’t you just use the alias path option so that you have the language folders? Or do you have the pages in each directory organized in sub pages for some other reason?
          • 28522
          • 29 Posts
          Should have been more clear about this:

          The site has an extensive 3 tier navigation with around 100 pages per language and 8 languages.

          I turned off the friendly site alias because i wanted to give each page its own custom .php name and not have it be in it’s parent directory HOWEVER each language needs to still be in the language directory that it’s in.

          I.e. in the english site, i do not want any page to reflect any structure in the URL except to be prefaced with /english/

          For example: My About Us directory has around 10 pages that need to all be www.site.com/English/pagename.php and not www.site.com/english/aboutus/pagename.php

          hopefully that makes things more clear, thanks a lot for the interest!
            • 33372
            • 1,611 Posts
            It sounds as if you’ve complicated your situation, and it’s not clear to an outsider why that’s necessary. But assuming it really is necessary, it looks to me as if you’d need to write a custom plugin to rewrite the links within MODx (to remove the last subdirectory if using friendly alias folders, or alternatively to add the language subfolder if you keep that off) and also modify your .htaccess file to redirect those URLs to MODx properly by stripping the language subdirectory. And that’s assuming that your page names (aliases) are all unique, since if they’re not I can’t see how you could make this work.

            Given how much work it can be to fit a square peg into a round hole, maybe it’s appropriate to reevaluate whether it’s truly necessary to do it this way? For example, if the reason you’re doing this is to maintain preexisting URLs for search engines, that would be a lot easier to do with .htaccess redirects or weblinks within MODx than what it seems like you’re proposing to do. The issue as I see it is that you’re using half of two different methods for rewriting URLs, but the two halves don’t make a coherent whole.

            Another way you could try to skin this cat (just to throw another irrelevant metaphor into this post) might be to include the language subdirectory as part of each document’s alias (e.g., english/pagename.php), but I’ve never tried that and I’m not sure how well it would work.
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn't very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
              • 3749
              • 24,544 Posts
              If I’m understanding you, the easy way would be to just flatten the directory structure.

              English
              page 1
              page 2
              ...
              page 100

              French
              page 1
              page 2
              ...
              page 100

              etc.

              You’d speed things up slightly and wouldn’t need to mess with the aliases, but navigating the pages in the Manager would get uglier -- especially if they have to be edited often.

              If you don’t want to do that, I think a plugin as ZAP suggests, could use the UltimateParent snippet to set the alias.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 28522
                • 29 Posts
                Alas, you guys have hit it on the head. It’s a disappointingly pointless way to build a website but my client is also disappointingly foreign and they refuse to heed my calls that Apache rewrites will prevent any loss of their precious SER.

                Intuitively though, it doesn’t seem like it’s that much to ask does it? If each language directory has 100 sub pages I should be able to give those sub pages nesting properties that would display in a menu but not reveal itself in URL structure but also include all those folders in a sub-directory (English/..)?

                I guess it’s the custom plug-in route for me,

                Damn Spanish clients...
                  • 16183
                  • 1,390 Posts
                  Quote from: steveb2 at Feb 05, 2009, 05:13 AM

                  Alas, you guys have hit it on the head. It’s a disappointingly pointless way to build a website but my client is also disappointingly foreign [snip......] Damn Spanish clients...

                  I appreciate your frustration but hmmm...careful now...your client may be browsing this forum too not to mention the possibility of someone taking offence....

                  Just thought I’d mention this wink

                  /k
                    • 4310
                    • 2,310 Posts
                    Clients being "difficult" is certainly not limited to one country laugh
                      • 33372
                      • 1,611 Posts
                      Have you tried the last idea that I threw out above (including the language and pagename in the alias field)? If that works, then you might be home free. You could turn off friendly alias paths (so your URLs would be written properly by the standard MODx methods) and still organize your documents into folders and sub-folders in the tree (which would allow you to use their ultimate parent value to determine what language each page is, limit searches to one language, etc.).
                        "Things are not what they appear to be; nor are they otherwise." - Buddha

                        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options