We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21120
    • 30 Posts
    so, i can’t seem to figure this out...

    I’d like the directory structure to be: http://www.example.com/clients/user/etc/etc/
    where user is a variable username, for instance - http://www.example.com/clients/neil/etc/

    I thought this would be pretty easy to achieve, and was messing around with symlinks and .htaccess rewrite rules for hours, but i haven’t gotten anywhere. is this even possible, or is there some simple solution that i’m overlooking?

    any help would be much appreciated! thanks!

    -neil
      • 3749
      • 24,544 Posts
      I might be missing something about what you want, but if you just create a "clients" Document and designate it as a container and then right click on it and select "Create Document Here" you should be able to create each client’s personal folder/document below it in the tree, then do the same with that folder to create the client’s subdirectories. Then you can use permissions to restrict users to their own section.
        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
        • 21120
        • 30 Posts
        I don’t want to do that, because all of the content in the documents below the "clients" folder will be dynamically pulled from the database. So, there’s essentially only 3 or 4 documents/directories in "clients" that every web user shares.

        Basically, the client "neil" would log in, and be sent to example.com/clients/neil/ where the "neil" folder is actually just the document "user" with a dynamic alias. however, everything i’ve tried leads to a 404 error because, legitimately, the document "neil" really doesn’t exist.
          • 5689
          • 289 Posts
          I believe what you want can be done, but I also don’t completely understand what you’re trying to do. Are you using MODx’s web users for the clients, or some custom system?
            I'm learning more about MODx all the time and loving it.
            • 3749
            • 24,544 Posts
            I assume that you’re using Revolution. I haven’t tried this, but I think it should work. I think you’ll have to have FURLs, friendly aliases, and friendely alias path’s turned on to get the alias you want but otherwise nothing special in .htaccess -- i.e. no rewrite rules except the ones needed for FURLs.

            Create the Client’s directory
            Clients

            Put a Client Home page under it, with the content "Client’s Home Page".

            Right click on Client and add a Symlink there.

            Give the Symlink the name and alias "Neil."

            In the Symlink field of the Symlink, put just the id of the Client Home page -- no link tag, no http:// -- just the number.

            If it works, you’re going to need a complete set of symlinks for each client (one for every real page), each with the ID of the real page in the Symlink field.

            You can use a snippet in the template to personalize each page with the client’s username.
              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