We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • discuss.answer
    • 46463
    • 8 Posts
    Well, I cried uncle and just reinstalled the site at the root. After doing that things worked flawlessly.

    I would respectfully suggest the FURL guide should be updated to encompass situations where MODX is installed in some directory other than the web root. I have to believe this is a pretty common scenario. The process of trying to get FURLs to work without the directory name showing up was maddening.

    Thanks to all for the input
      • 3749
      • 24,544 Posts
      I'm glad you got it sorted and I'm sorry none of my suggestions worked. I wouldn't know what to add to the FURL guide to clarify things, since we never found anything that worked at your site. wink

      What's there now seems to work for most people, even when MODX is in a sub-directory.
        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
        • 46577
        • 54 Posts
        Quote from: lankford at Jul 29, 2014, 09:58 PM
        Well, I cried uncle and just reinstalled the site at the root. After doing that things worked flawlessly.

        I would respectfully suggest the FURL guide should be updated to encompass situations where MODX is installed in some directory other than the web root. I have to believe this is a pretty common scenario. The process of trying to get FURLs to work without the directory name showing up was maddening.

        Thanks to all for the input

        +1 for this suggestion. Here's what the docs say about it:

        Development sites often begin in a subdirectory, and then are moved to the root directory when completed. The subdirectory method is useful if you've got an existing site that must remain available during development, or for subdomain MODX installations. It is also possible to leave MODX in a subdirectory and use .htaccess to rewrite your urls to the root.

        After reading that I went ahead and installed in a subdirectory, expecting to be able to quickly reconfigure my site when it was ready. Now I am at that point, and searching all over for a concise description of the method, which does not appear to exist after all sad Looks like I will have to reinstall in the root.
          • 3749
          • 24,544 Posts
          Here's one method:


          1. If there's a site in the root, back it up.
          2. Copy the files from the sub-directory to the root (including the setup directory -- if it's not there, copy it from the .zip package).
          3. Rename the sub-directory to make sure it's not in play.
          4. Run setup (yoursite/com/setup).

            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
            • 46463
            • 8 Posts
            FWIW, I found installing with the advanced install package was the key: http://rtfm.modx.com/revolution/2.x/getting-started/installation/advanced-installation

            During that install, I set the path to the site to be / (i.e. the root), despite actually installing in a subdirectory. This put MODX where I needed it while allowing FURLs to work as they should.

            It might be good to make that tip more prominent in the docs - i.e. the connection between using the advanced install, FURLs, and sanity. smiley
            • If the installation is in a properly configured subdomain, sub.domain.com, it doesn't matter. If it's just in a subdirectory, domain.com/subdirectory/, then you need to edit the .htaccess file or other rewrite settings
              RewriteBase /subdir/
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 44580
                • 189 Posts
                There seems to be many different ways to get a result. Here is one that works for me (I have three sites off one root and furls working for all of them).

                1. Install modx into a subdirectory of the root (eg /var/www/mysite) using the standard install (lankford, I don't believe advanced install is needed).

                2. Put .htaccess in that subdirectory but with a RewriteBase of / (yes, this is not what the doco says but it works). This is what my .htaccess looks like:
                RewriteBase /
                
                # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
                RewriteCond %{HTTP_HOST} .
                RewriteCond %{HTTP_HOST} !^mysite\.com [NC]
                RewriteRule (.*) http://mysite.com/$1 [R=301,L]
                

                3. Set up furls as per the rtfm (or this is how I did it for Articles, but it is the same process - just clarified for my benefit: http://rgissing.com/blog/modx-revo-friendly-urls/)

                4. Add an entry for mysite.com in /etc/apache2/sites-available. I covered this earlier in this thread for those who, like me, have access to the filesystem. For others, provided you have access to cpanel, I believe the same thing can be done using that tool (see this thread: http://forums.cpanel.net/showthread.php?p=1450471). But I have not tested this.

                5. Restart Apache.
                  • 46577
                  • 54 Posts
                  Ok I got it done, bit of a bumpy ride though.

                  First tried Bob's method (Reply #14) but when I tried running setup all I got was a blank page.

                  What to do? I've got to get this site up and can't wait for forum help. I'm too far down the hole now to try any of the other suggestions, so...

                  Next I uploaded a completely fresh copy of MODX. Setup ran ok but only allowed me to choose 'New Installation' i.e. 'Upgrade' and 'Advanced Upgrade' radio buttons could not be selected. Then of course I couldn't get past the database test (prefix already in use). So I had to create a new database and import my backup. Plus a few other niggles (I had to force remove and reinstall my packages to get Wayland and TinyMCE to work for example - guess that makes sense if my database says they're installed but they aren't really).

                  Well hey it all happened in the end but leaves me thinking it shouldn't be this hard, and a feeling of trepidation for my next site. [ed. note: grogorio last edited this post 9 years, 9 months ago.]
                    • 3749
                    • 24,544 Posts
                    @ Gissirob: It's my understanding that, as Susan says, if you point the domain at the subdirectory (as you do), setting the Rewrite Base to / is correct. If you don't, you need to put the subdirectory name in the Rewrite Base line: /subdirName/.

                    @grogorio: I'm sorry you had so much trouble. I can say that what you experienced is fairly rare and I strongly suspect that your situation was fixable by some combination of fixing the .htaccess and the values in the config files. Almost certainly, one of your config.core.php files was wrong (or the Rewrite Base was wrong). That's why Setup couldn't find your config.inc.php file and wanted to do a new install.

                    I leave FURLs off and have no .htaccess file until everything is working. That helps a lot, because it takes the .htaccess issues out of the equation.

                      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