We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23851
    • 19 Posts
    So should the .htaccess file be in the web root, or the "modx" subdirectory? Seems that something has to be in the web root, otherwise how would someone be able to access my site with the generic URL: www.mysite.com?
    • I would presume so; hopefully somebody better versed in this area can answer that.
        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
      • Quote from: preston at Feb 04, 2006, 05:51 PM

        So should the .htaccess file be in the web root, or the "modx" subdirectory? Seems that something has to be in the web root, otherwise how would someone be able to access my site with the generic URL: www.mysite.com?

        Preston you wouldn’t want it in a subdirectory called /modx unless you wanted the URL to access it from to be mysite.com/modx/. To have the site available from the web root, it must be in the web root. Nothing fancy or tricky going on here... wink
          • 23851
          • 19 Posts
          Thanks Jason.  Things are working almost as I’d like.  My .htaccess has the following:

          Redirect /index.html http://mydomain.com/modx
          RewriteRule ^(.*)$ /modx/index.php?q=$1 [L,QSA]

          The only thing I don’t like about this arrangement is that "modx" is shown in the URL, and I’d rather not have this extra level of structure visible.  Are there any other rewrite rules that could mask this?
          • Again, I think someone confused you. If you want the site to show at the root of the domain, and not /modx, just move the contents of the entire /modx directory to the root. I’ve never run a site by redirecting from the root to a subdirectory, and do not recommend it, though it would probably work eventually.

            So, just get rid of the /modx directory altogether and move the content to the root.
              • 23851
              • 19 Posts
              Quote from: OpenGeek at Feb 05, 2006, 12:55 AM

              Again, I think someone confused you.  If you want the site to show at the root of the domain, and not /modx, just move the contents of the entire /modx directory to the root.  I’ve never run a site by redirecting from the root to a subdirectory, and do not recommend it, though it would probably work eventually.

              So, just get rid of the /modx directory altogether and move the content to the root.

              Ah but there’s the rub. The whole reason I’m going through all these machinations is that my site already has a "manager" subdirectory off my web root that’s used by the site’s control panel software. This subdirectory cannot be renamed, and apparently neither can MODx’s, thus I’m probably going to resort to some inelegant workaround.
              • The place I’d got for inelegant assistance wink is the Mod_rewrite forums. Some amazing stuff there.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me