We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38441
    • 140 Posts
    Hi, I'm new to Modx and just installed 2.2.0 for the first time onto a hosting account with a temporary url (using ../~username). I've copied the files of an existing website into this new hosting account and installed modx with no problem.

    However, as i begin to retro fit an existing website into modx, i notice that it's changing all the site's URL's. The pages of the existing site are all .html and as i add them into modx, i notice the file extensions become .php (with all sorts of additional characters and symbols in there). As a newbie here, is there a way to keep the site's URL's as they are, or is this change un-avoidable. What is the best advice when installing modx into an existing website like this? (since all backlinks will need changing and redirects set up).

    One last thing, since the website and modx install is on a hosting account using a temporary url, is there any specific action or factors to take into account at the point of connecting the live domain name to this new host?
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      You'll need to enable friendly URL's.

      See: http://rtfm.modx.com/display/revolution20/Using+Friendly+URLs

      You'll want to make sure that you set the .htaccess to point to the directory where you installed MODX as well.

      Edit: this recent thread has information about moving your site. https://forums.modx.com/thread/73610/the-best-way-to-develop-a-modx-site#dis-post-408934 [ed. note: frogabog last edited this post 14 years, 8 months ago.]
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 38441
        • 140 Posts
        Thanks. But i'm sure i've seen in many tutorials and guides that FURL's need to be disabled for some reason when using modx on a temporary URL- in prequel of live domain being connected to host account.. (my temp url is the "ip address"/~username).

        Im still quite confused about the process of installing modx on a temporary url such as this, and then what happens when i connect the domain to this account at the point of going live. Currently, if i visit my ip-address/~username, i'm not seeing the modx version of the site, instead i see the site files in the root (as i'm used to seeing during traditional static website design and builds).. So basically, is this why i need to change the .htaccess? -So that it points to my modx install (all the modx components aren't placed inside their own folder called 'modx', instead i just have all the modx files sat in the root of the host.


        (excuse my v.basic understanding here, i've always been more visual design orientated than technically minded, but trying to qualify myself up to the next level in website design & build!).
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          You can create your alias's as you build the site or if set to do so (settings->FURL's->automatically create alias) MODX does it for you. It will use the document name for the alias.

          When you modify the url's within the document, use
          src="[[++site_url]]assets/templates/yourSite/yourFileName"
          so that when you move the site, it automatically pulls the new site address.

          I'm not aware of any hard rule that says you can't use the FURL's while developing. One of the fabulous things about MODX is that you can use the MODX tags to make it so you never have to change any of the url's, regardless of where you move the site in the future. Just keep all your site files in the same location as you have in development and it all falls into place.

          One tip I've been using lately which has simplified things nicely has been to set up a custom setting for my image files. I'm using
          "[[++images]]imageFile.png"
          before all my image files now instead of
          "[[++site_url]]assets/templates/main/images/imageFile.png"
          which works beautifully. Again, this allows you to move your site to your hearts content as long as all the site files remain in the original locations. (in settings, click "create new setting" button to make a custom setting)

          The FURL's will update when you go live. I would turn it all on now so you can get a feel for how it works and looks.

          I've found that even with the site in the root, pointing .htaccess to that specific folder is necessary. Pretty sure this is why you're seeing the folders instead of your site. In your case it'd be your username. When you go live, just change that to the new root folder name and it should work just fine.

          And please... no worries about not knowing these things. It can be confusing. I've been re-reading through the Susan Sottwell's MODX information again, now that I'm not as confused as I was at first... it's making lots more sense this time (just substitute Revo tags for the Evo tags).

          http://sottwell.com/how-modx-works.html

          Additionally I've found Menno Pieterson's video tutorials and blog quite informative.
          http://sottwell.com/how-modx-works.html

          Mary's site also has tutorials a plenty to choose from.
          http://codingpad.maryspad.com/

          There's also a massive amount of Russian language video tutorials available on Youtube, etc. if that works for you. I wish I knew Russian!
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Oh, I forgot to mention that you can't use the MODX tags in your css files. That is the one location that you'll need to watch and modify when you move your site. I find that nothing but the absolute url works in the css but I think that is more due to me not typing the relative url correctly.

            You can put your css files into MODX itself, I think, by setting the resource to the css filetype and pointing to the resource ID but I am not that advanced and haven't actually done it that way (it confuses me still). I actually prefer to have everything in static resources so I can edit outside of MODX. With Media Sources in MODX 2.2.x, this is incredibly easy.
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 38441
              • 140 Posts
              Thanks again. When you say..

              I've found that even with the site in the root, pointing .htaccess to that specific folder is necessary. Pretty sure this is why you're seeing the folders instead of your site. In your case it'd be your username. When you go live, just change that to the new root folder name and it should work just fine.

              What is the specific folder to point to that you mention here, the modx folder named manager? I have a .htaccess file in my root which appears to be empty, and a ht.access from the revo install. How do i point a htaccess file at a specific folder?

              To clarify, right now i have the following file structure in my host account/ root-

              FOLDERS-
              assets
              cgi-bin
              connectors
              core
              css
              image
              manager
              scripts

              FILES-
              config.core.php
              index.php (which i think is part of the modx install)
              & 30+ .html files that are all the pages of an existing website i have copied over into this host account, which i'm hoping to make editable via modx.

              (I've seen in numerous articles and videos that files such as css & images etc are supposed to be placed into the assets folder or templates folder of modx, i haven't put any files into modx and yet it still appears to be finding the correct files i think..)

              I ask these things because all is not yet clear to me and when i preview a document inside modx, i can view it, and if i type my temporary url into the browser i can also see my site files. However, these aren't the pages from modx.
                • 38441
                • 140 Posts
                I forgot, also, i read that i need to include <base href="[(site_url)]"></base> in the head section of any template. What is the purpose of this and is there anything else i should modify in relation to adding this in the code. (& in the "site_url" bit, am i supposed to write my domain name in there?)
                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  Quote from: jaykaye at Jan 25, 2012, 12:35 PM
                  Thanks again. When you say..

                  What is the specific folder to point to that you mention here, the modx folder named manager? I have a .htaccess file in my root which appears to be empty, and a ht.access from the revo install. How do i point a htaccess file at a specific folder?

                  open the Revolution ht.access file in your text editor. Then Save As ".htaccess" in the same location. Edit the .htaccess file here and save (it should rewrite your current blank .htaccess):

                  # Make sure RewriteBase points to the directory where you installed MODX.
                  # E.g., "/modx" if your installation is in a "modx" subdirectory.
                  #
                  # You may choose to make your URLs non-case-sensitive by adding a NC directive
                  # to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
                  
                  RewriteEngine On
                  RewriteBase /yourMODXDirectory
                  


                  (I've seen in numerous articles and videos that files such as css & images etc are supposed to be placed into the assets folder or templates folder of modx, i haven't put any files into modx and yet it still appears to be finding the correct files i think..)

                  I ask these things because all is not yet clear to me and when i preview a document inside modx, i can view it, and if i type my temporary url into the browser i can also see my site files. However, these aren't the pages from modx.

                  The assets/templates/yoursite location is a good spot for your files although you can place them anywhere within the MODX directory that you desire.

                  The reason your site is working when you type the url in is because you've got the files in that location. Just like if you stuck them in the public_html folder on your server, if you type that url in, the page pops up. What you'll want to do is create a template for your site where you either place the common html directly into the template itself (the full <!doctype> all the <meta>, the <head>, and the <header>) just like normal, or you can place that constant html into a chunk and call it in the template (site_header chunk).

                  Then, you'll create pages (otherwise known as documents or resources) in MODX that mimic your site structure (this is how Wayfinder creates your menu - container resources should have child resources if you want sub-pages). Each page will use whichever template you choose for it. You can have as many templates as you desire if your pages won't all have the same look. You can then either put the page's main content into the content section of each page within MODX, or you can just make html files (stored in assets/templates/yoursite most commonly) with that content (without header and footer of course) and use Static Resources to tell MODX where to look for the code.

                  Using FURL settings, when you create new pages in MODX, if you set it to automatically create the alias it will use the page title. If you want the menu to display something other than the page title, enter that into the menu title field.

                  To get started, copy or move your current directories (css, images, scripts) into the assets/templates/yoursite location. Just place them "as is" into this directory. Then you can edit them as needed and use static resources to call them into modx resources as you like. You'll be removing anything that you place in your templates from these html files if you are going to use static resources. Otherwise you'll end up with duplicate content when your page renders. The chunk files can also be stored there and referenced in the same way.

                  Hope this helps a bit.

                  The tutorials here are very helpful to understand how this all works. http://vimeo.com/mennopietersen
                  Also, the written tutorials to go with are here: http://designfromwithin.com/
                    Frogabog- MODX Websites in Portland Oregon
                    "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                    Having server issues? These guys have MODX Hosting perfected - SkyToaster
                    • 38441
                    • 140 Posts
                    Thanks so much for taking the time to write this, i've been sat here for the last 9 hours getting my head around it all, and i will continue to read through the links you've supplied as well.