We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7869
    • 118 Posts
    I’m drawing a blank on how to accomplish this task. undecided

    I’ve made a US-product affiliate site with MODx and now I want to duplicate it with UK content. Is there any way I can do this so that the UK pages can be found at http://www.my-site.com/uk ? With my current site, I’m using friendly URLs and friendly aliases without friendly alias paths which means all URLs to my site look like http://www.my-site.com/product-name.html. It doesn’t matter how far down the directory tree goes, every page looks like it’s at the root level because friendly alias paths are turned off.

    Anyway, it seems to me that the only way to do this is to install a second Manager at my-site.com/uk and then I’ll have to switch between the two Managers depending which "version" of my site I want to edit. Surely there’s a way to do this from the original Manager, right? wink Hope all that made sense. Thanks for any advice.
      -Dorian
      • 37550 ☆ A M B ☆
      • 711 Posts
      You could make two installs of MODx

      1. being in the wwwroot (default us site)
      2. being in the wwwroot\uk folder

      However the two installations / managers will never talk to each other or share.

      If the UK content is very different to the US content i would recommend using friendly alias paths.

      That way you could keep your us site at the root then create a folder call UK in manager and build all your uk content their.

      so the end user would be able to visit http://www.yourdomain.com/products.html (us)

      http://www.yourdomain.com/uk/products.html

      or you could go a step further and put all your shared documents on the root of the site i.e contact us, about us etc and then put your US content in a subfolder like the UK.
        http://www.onesmarthost.co.uk
        UK MODX Hosting with love.
        • 7869
        • 118 Posts
        Quote from: Onesmarthost at Feb 03, 2009, 01:50 AM

        If the UK content is very different to the US content i would recommend using friendly alias paths.
        This is what I thought of doing, but then I’d have to mod_rewrite my existing URLs and every time I edit mod_rewrite, no matter how precise I think I got my regex’s they never work and then everything on the site gets messed up and then Google de-indexes it. sad
          -Dorian
          • 37550 ☆ A M B ☆
          • 711 Posts
          My mod rewrite rules are pretty easier and should cover what you need.


          RewriteRule ^/(?!(?:manager|assets)/)(.*)\.html(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]
          RewriteRule ^/(?!(?:manager|assets)/)(.*)\.xml(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]

          The above will rewrite root docs i.e, /aboutus.html and also folder paths i.e

          /uk/products.html
          /us/products.html
            http://www.onesmarthost.co.uk
            UK MODX Hosting with love.
            • 7869
            • 118 Posts
            Was I supposed to make any edits to those two lines? They gave the same error that I always get whenever I edit the .htaccess file.

            Internal Server Error

            The server encountered an internal error or misconfiguration and was unable to complete your request.

            Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.

            More information about this error may be available in the server error log.

            Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

            Apache/1.3.41
              -Dorian
              • 37550 ☆ A M B ☆
              • 711 Posts
              This is our entire .htacess file which runs on IIS ISAPI Rewrite I am told this should work on linux too.

              If not the default modx ht.access should work for you and just needs renaming to .htaccess



              # Helicon ISAPI_Rewrite configuration file
              # Version 3.1.0.48

              RewriteEngine On
              RewriteCompatibility2 On
              RepeatLimit 32
              RewriteBase

              # Block external access to the httpd.ini and httpd.parse.errors files
              RewriteRule ^/httpd(?:\.ini|\.parse\.errors).*$ / [NC,F,O]

              # Block external access to the Helper ISAPI Extension
              RewriteRule ^.*\.isrwhlp$ / [NC,F,O]


              RewriteRule ^/(?!(?:manager|assets)/)(.*)\.html(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]
              RewriteRule ^/(?!(?:manager|assets)/)(.*)\.xml(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]
                http://www.onesmarthost.co.uk
                UK MODX Hosting with love.
                • 7869
                • 118 Posts
                The default ht.access file is what I’m using (renamed to .htaccess, of course). The only changes I made to it were uncommenting register_globals (to turn them off) and the section near the top the rewrites the domain with a www in front. But when I add your two lines of code, the server doesn’t like it. huh
                  -Dorian
                  • 3749
                  • 24,544 Posts
                  Quote from: DorianJ at Feb 03, 2009, 11:35 PM

                  The default ht.access file is what I’m using (renamed to .htaccess, of course). The only changes I made to it were uncommenting register_globals (to turn them off) and the section near the top the rewrites the domain with a www in front. But when I add your two lines of code, the server doesn’t like it. huh

                  Some servers don’t like any php in the .htaccess file and throw a server error when they run into the line that turns off register_globals.
                    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
                    • 7869
                    • 118 Posts
                    You mean this line...

                    #php_flag register_globals Off

                    This is how I’ve been disabling register_globals with my current host for about two years now. If the server didn’t like it, would I have found out a long time ago? Or would these new RewriteRules effect it some way?
                      -Dorian
                      • 3749
                      • 24,544 Posts
                      Quote from: DorianJ at Feb 03, 2009, 11:56 PM

                      You mean this line...

                      #php_flag register_globals Off

                      This is how I’ve been disabling register_globals with my current host for about two years now. If the server didn’t like it, would I have found out a long time ago? Or would these new RewriteRules effect it some way?

                      Right -- that’s the line. The rewrite lines shouldn’t affect that. It’s probably not your problem unless something has changed at your host.
                        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