We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22448
    • 241 Posts
    Hi All,
    i’ve been struggling with this problem and need the community’s help. In my site MODx is installed in the /htddocs/modx subdicrectory to accommodate other non-modx modules. However, currently I see www.sitedomain.com/modx/page.html for all pages(except home). Instead it i’d like to see www.sitedomain.com/page.html.
    The friendly URLs are on and working but keep including the /modx/ like so: www.sitedomain.com/modx/page.html. So I assume they get it from the basepath. Is there a way to manually change the basepath to force FURL to generate www.sitedomain.com/page.html so i can handle everything else with some modrewrite rules?

    If changing the basepath is not the way to go, what is?

    Any help would be greatly appreciated.
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Take a look at this: http://tips-scripts.com/pointing I don’t know if it will solve your problem or not, but it should get you going in the right direction.

      AMDbuilder
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 22448
        • 241 Posts
        Thanks AMDBuilider,

        that’s good information. Unfortunately the main problem is in the fact that the MODx generated friendly URLs already include /mods/ in them. So when a user clicks on that link the url displayed in the browser’s address bar already includes /modx/. That is what i’m trying to prevent.

        There’s some code in the index.php that sets the site’s base path, but i have not been able to find where to set basepath to override that dynamic setting.

        Anybody?
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          I was thinking if you used the one link and then changed the htaccess to reflect the desired path it should work. Untested, but it might work.

          AMDbuilder
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 7231
            • 4,205 Posts
            I think that if you want /htddocs/modx to be the root directory on your host you will need to edit the httpd.conf (apache configuration file) to define this. Usually httpdocs is the root. The path that is being set dynamically is the path that the host thinks is the root path.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 22448
              • 241 Posts
              That’s what we ended up doing. We moved MODx into the web root, which produced the desired effect, i.e. removed /modx/ from the url. Then in order to accommodate our external modules we created svn:externals links from all external modules into MODx folder tree, which gave us what we ultimately wanted: a one click checkout/deployment from our SVN master repository to the developers working copies or into production.

              Thanks to all who helped.
              The answer seems to be the following: there is no easy way to manually change MODx base path to something other than it’s real path in relationship to the web root.

                • 7231
                • 4,205 Posts
                Glad you worked it out?

                ..what we ultimately wanted: a one click checkout/deployment from our SVN master repository to the developers working copies or into production.
                That sounds cool, I would like to learn how to do this. grin
                  [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                  Something is happening here, but you don't know what it is.
                  Do you, Mr. Jones? - [bob dylan]