We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1100
    • 20 Posts
    I’ve been reading about deploying a locally developed site onto a server - i’m using xampp and deploying onto lamp so have the same development setup as your documentation support.

    In the documentation and on the WiKi the following is stated:-
    "Install the site locally, renaming and editing the .htaccess file to indicate the subdirectory you are deploying your site into in the test environment" etc...

    My question - is it imperative that I do this .htaccess editing etc at the beginning of the project? I need to know now at the start of the project in case it’s too late once I’ve got heavily into my templating or, worse, at the end when I want to port the site.

    Thanks
      • 4707
      • 73 Posts
      AFAIK, that particular .htaccess editing is needed if you want to activate friendly urls. For example, my local xamp .htaccess has the following line:
      RewriteBase /www/site_folder/

      as the local access url is http://localhost/www/site_folder/

      But in my lamp host, the RewriteBase is just set to /
      RewriteBase /

      as the site access url is http://site_domain.com
        • 1100
        • 20 Posts
        Thanks for the reply and info.
        So you would say that it’s not imperative to edit .htaccess simply to port to a remote server? only for friendly url’s? (which i think i will actually use)

        BTW, what is AFAIK? ;-)
          • 4707
          • 73 Posts
          That’s right, AFAIK wink Only for friendly urls you need to edit the RewriteBase directive, making it match the path to your MODx files from the DocumentRoot ("htdocs" folder in local xamp and "public_html" folder in [at least in my] remote host).

          But your templates files shouldn’t depend on the RewriteBase path. There are some MODx tags like [(site_url)] and [(base_url)] that you can use for absolute paths.
            • 1100
            • 20 Posts
            Okay, I can see what’s needed there for friendly url’s. However... sorry to keep going on about this, but I’ve been looking at the following page to find out how to port to a server: http://wiki.modxcms.com/index.php/Moving_Site_To_Another_Location

            I gotta admit that I’m pretty stumped by this bit:
            "Install the site locally, renaming and editing the .htaccess file to indicate the subdirectory you are deploying your site into in the test environment"
            and:
            "Don’t forget to rename the .htaccess file in the /manager folder to turn off the RewriteEngine for that folder"

            The editing bit is straight forward, but what is .htaccess actually renamed to?
            If there are any other ’moving to server’ tutes out there I’d be keen to read them!

            Thanks.
              • 10487 MODX Staff
              • 1,535 Posts
              On a standard install, the file is called ’ht.access’ which you would then need to rename to ’.htaccess’ if you needed to use it for friendly URLs. Of course, if it’s already called ’.htaccess’ then you won’t need to rename the file.
                Garry Nutting
                Senior Developer
                MODX, LLC

                Email: [email protected]
                Twitter: @garryn
                Web: modx.com
                • 1100
                • 20 Posts
                Thanks - I’m clear about renaming .htaccess for friendly url’s - it’s the renaming process for porting the site from xampp local to lamp server which stumps me.

                Let’s say that I’m not going to use friendly url’s - do I still need to rename ht.access in order to port from local to server? as that is what the documentation implies in the following:

                "Install the site locally, renaming and editing the .htaccess file to indicate the subdirectory you are deploying your site into in the test environment"
                and:
                "Don’t forget to rename the .htaccess file in the /manager folder to turn off the RewriteEngine for that folder"

                All of this is stated in the tute at http://wiki.modxcms.com/index.php/Moving_Site_To_Another_Location but it doesn’t mention friendly url’s at all; this is all in relation to moving from local to server.

                Thanks
                  • 4707
                  • 73 Posts
                  If you are not going to use friendly urls, then you don’t need to do anything about renaming ht.accesss to .htaccess or modifying the file.

                  Still, you might still want to have a .htaccess file in order to turn on php compression or turn off register globals. But that’s another story.

                  The tutorial in the wiki implies that friendly urls are active in the site you want to move.
                    • 1100
                    • 20 Posts
                    Okay, thanks for clearing that up, and sorry for not replying before now. I’ll research about .htaccess for php compression and turning off register globals, because the site I’m developing for will be deployed on a server with register_globals set to on.