We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23851
    • 19 Posts
    Hello -

    I’m converting an existing site from static HTML to MODx. For testing purposes, I’ve setup MODx under a subdomain: modx.domain.com. I added a couple pages, and all worked well. So then I turned on friendly URLs. The friendly URL generated for the new link, for instance, is correct on the home page: http://modx.domain.com/Page-5.html. However, when I click it I receive:

    The requested URL /Page-5.html was not found on this server

    I have setup the .htaccess file in my site root per the instuctions. Initially I just used the default values. When that didn’t work, I tried setting the rewrite rule to use my full path as follows:

    RewriteRule ^(.*)$ /var/CMS/MODx/index.php?q=$1 [L,QSA]

    Still no joy. No doubt there’s something basic I’m missing, but I’m by no means an Apache or PHP expert. Any help would be appreciated.

    Thanks,
    Preston
      • 33337
      • 3,975 Posts
      If your MODx installation is in root (public_html, htdocs etc) you need to rename ht.access to .htaccess in root and one in manager/.

      Secondly, if you installation is in subfolder, for example:

      /modx/....

      then you should use /modx/index.php to get FURL work.

      I hope this helps

      regards,

      zi
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 23851
        • 19 Posts
        Yes, I’ve already renamed ht.access to .htaccess, though I haven’t done this for the manager ht.access.

        I guess one thing that’s unclear to me are the references to ’root’ and ’subfolder’. Are we talking about the Linux root here, or the web root? As I mentioned, the modx installation is in the Linux subdirectory /var/CMS/MODx, but that is the root of the site.
          • 10487 MODX Staff
          • 1,535 Posts
          Hi Preston,

          It’s the web root.

          So if you need to type: http://www.mysite.com/modx/ to get to your install of ModX then add /modx/ in the rewrite statement of the .htaccess file.

          Regards, Garry
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 23851
            • 19 Posts
            Quote from: garryn at Jan 31, 2006, 05:31 PM

            It’s the web root.
            In that case, my site is in the web root, so the .htaccess file should work in it’s default form, correct?  Could the problem be that the site is setup as a subdomain?  What would be the best approach to troubleshooting this?
              • 10487 MODX Staff
              • 1,535 Posts
              I suspect it is to do with the install being set up as a sub domain, unfortunately that’s about as my .htaccess knowledge goes. undecided

              Is there any way to map the install to the main web domain rather than a sub domain? You could then test it to see if the Rewrites are working on the main domain, that would narrow down the issue.

              I’ll do a bit digging and see if I can come up with anything else ...

              Regards, Garry
                Garry Nutting
                Senior Developer
                MODX, LLC

                Email: [email protected]
                Twitter: @garryn
                Web: modx.com
                • 32241
                • 1,495 Posts
                Hemm... I suppose subdomain setup will not break the system, ever since subdomain is the same as domain. What hosting are you using? It might be the hosting, if it break because the subdomain setup, because there is a hosting company that do a weird way of creating a virtual subdomain or domain.

                Did you enabled all the SEF option and configure it right inside the manager yet? I know it’s a stupid question, but you might miss the config.

                Did you install it on apache server?
                Did you publish your document yet?

                What kind of error message that you received? The nice one from MODx or the ugly one from default apache server?
                  Wendy Novianto
                  [font=Verdana]PT DJAMOER Technology Media
                  [font=Verdana]Xituz Media
                  • 23851
                  • 19 Posts
                  Well, I installed it in a subdirectory off my regular domain, and the friendly URLs work fine. I guess there’s something squirrelly with sub-domains, but I’m not sure where to start looking. I’ve got couple already setup on my non-MODx site, and have never had a problem.

                  The message I received was a 404 error from Apache, and took the following form:

                  "The requested URL /Page-10.html was not found on this server."

                  I intend to setup a separate staging area, as well as a sandbox, and felt sub-domains would be a clean way to accomplish this.
                    • 25663 MODX Staff
                    • 12,272 Posts
                    You need to modify your .htaccess per the instructions located in it about installing in a subfolder.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 23851
                      • 19 Posts
                      I already tried modifying .htaccess numerous times, Ryan, but perhaps I’m not doing so incorrectly.  Suppose:

                      - My subdomain is modx.domain.com
                      - The Linux root folder designated as the web root for that subdomain is: /var/CMS/MODx

                      The default values in .htaccess didn’t work, so I then tried this:

                      RewriteRule ^(.*)$ /var/CMS/MODx/index.php?q=$1 [L,QSA]

                      which didn’t work either.  Based on a previous reply from Garry, it seems that the default RewriteRule (without the path) should have worked, since MODx in installed in the web root for the subdomain.  Perhaps I should mention that /var/CMS/MODx is not a subdirectory off the primary domain’s web root.

                      Have I done something improperly?  Any suggestions on troubleshooting why it fails in the subdomain?

                      Thanks.