We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37967
    • 9 Posts
    Hi folks

    I've had a bit of a hunt and done a search and can't seem to find any enlightenment on a slightly odd problem

    I'm just building my first site in Revolution (2.1.5-pl) after building a couple in Evolution. I think I'm getting to grips with the new syntax and I've basically built the site and used Wayfinder for the menu, but whenever I click a menu item in the front end, it just reloads the home page content (the proper content exists in the Manager). Does anyone have any bright ideas or would anyone be prepared to take a quick look to see if there's anything glaringly obviously wrong? The site is hosted with the same company as the other 2 Evo sites (which are working fine) and indeed on the same account as one of them
      • 3749
      • 24,544 Posts
      The home page is the default error (page-not-found) page, so you'll end up there whenever a page isn't found. Often the URL shown in the browser's address bar is a clue to where it's looking for the pages.

      The first thing to try is making sure you have this in the head section of all your templates:

      <base href="[[++site_url]] />


      If that doesn't do it:

      Do you have friendly URLs turned on? If so, try turning them off. If that fixes it, it's most likely a problem with your .htaccess file.

      If you you're using XAMPP on localhost, make sure mod_rewrite is enabled (it's off by default).
        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
        • 37967
        • 9 Posts
        Thanks for that, it was indeed the friendly URLs. However, I've renamed ht.access to .htaccess and added the subdirectory to the rewriteBase line as instructed in the file, but turning FURLs back on reverts to the original issue. FURLs are only a "nice to have", the site functioning is the critical issue, but still, I don't like not knowing why things aren't working [ed. note: pipemma1 last edited this post 14 years, 9 months ago.]
          • 3749
          • 24,544 Posts
          I don't really understand why, but the subdirectory name is often necessary on localhost installs, but not on a remote server. Try this:

          RewriteBase /
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            If the domain is a virtual host, such as forums.modx.com, then the subdirectory name is not necessary; the web server manages the subdomain location internally. If we all took the time to actually create the virtual hosts in our web server's config files we wouldn't need to have the subdirectory in our localhost either.

            For example, on my Bluehost account I have five installation, all in subdirectories. My main sottwell.com site is in the root, the rest are virtual hosts, either distinct domains in their own right or subdomains to sottwell.com. None of them have the subdirectory in their RewriteBase lines. However, since I don't care to go to the trouble of creating a virtual host every time I install on my localhost, each one does require the /subdir setting.

            http://httpd.apache.org/docs/2.0/vhosts/

            For example, http://babyroo.com can also be accessed as http://sottwell.com/babyroo. Likewise http://dev.sottwell.com can also be reached at http://sottwell.com/dev. Of course, the .htaccess can be configured to rewrite all requests for sottwell.com/babyroo to babyroo.com, and since it's a virtual host that will work. [ed. note: sottwell last edited this post 14 years, 9 months ago.]
              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
              • 3749
              • 24,544 Posts
              Thanks Susan. I think that's the second time you've explained this to me. Maybe this time it will stick. wink
                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
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Just for information, the two distinct add-on domains that I have (that are not simply subdomains to my main sottwell.com) are redirected from sottwell.com/directory with a simple one-liner in the main .htaccess file
                RedirectMatch 301 /directory/$ http ://domain.com/


                This is relevant to Bluehost, which uses subdirectories off the root for addon domains as well as subdomains.

                (interesting; the forum makes links out of urls in code tags!)
                  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