We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38261
    • 3 Posts
    The .htaccess file was recently changed through MODx. Now the site redirects, and I am unable to login to the manager and revert the file. The site is completely down. How do I access the manager to revert the file? Any help would be greatly appreciated.
      • 9102 ☆ A M B ☆
      • 318 Posts
      Do you have FTP access or any other access to the hosting environment? If not, I would probably contact the webhost for help.
        • 38261
        • 3 Posts
        freejung. I've just contacted the webhost and awaiting reply. Do you have any suggestions on solutions? On what I should ask the hosts to do?
          • 3749
          • 24,544 Posts
          If you have cPanel access, you should be able to edit the .htaccess file in File Manager.

          BTW, what does this mean, exactly: "The .htaccess file was recently changed through MODx." ?

          ---------------------------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
          MODx info for everyone: http://bobsguides.com/MODx.html
            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
            • 38261
            • 3 Posts
            Ay, mates thanks for taking the time. The host support came through in a pinch. It's all resolved.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              BobRay, I think the MODx file manager was used to edit the .htaccess file.
                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
                That was my first guess, but I thought it might be possible that a new version of MODX modified it during the install

                ---------------------------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
                MODx info for everyone: http://bobsguides.com/MODx.html
                  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
                  • 9102 ☆ A M B ☆
                  • 318 Posts
                  Sorry I didn't respond to your followup - I'm glad everything worked out. Just for reference, probably the easiest thing to do in this situation would be to simply ask the webhost to rename .htaccess, which should restore your access to the manager. You could then use the manager to make corrections to the renamed file, and then name it back to .htaccess. If you get the corrections wrong you may lock yourself out again, but then you could just repeat the process.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    It's almost impossible to properly manage any website without access to the file system (an FTP client) and access to the database. Most hosting control panels also have a file manager of some kind, as well as providing access to the database, usually phpMyAdmin for accessing MySQL databases.
                      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
                      On my host, I can edit .htaccess inside MODX, but it shows as locked in the MODX file tree and I get an error message when I try to save it -- though it is, in fact, saved.

                      This is a bad practice, though, (as you found out) because one tiny error in .htaccess and you're locked out of the Manager. It's much better to do it outside of MODX, back up .htaccess before each change, and check to see if the home page loads in another browser after each change is saved.

                      ---------------------------------------------------------------------------------------------------------------
                      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
                      MODx info for everyone: http://bobsguides.com/MODx.html
                        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