We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51474
    • 27 Posts
    I'm using ModX Revo 2.4.2-pl

    I'm having no problem on saving Any resources on my local machine.
    But when I uploaded all my files to production server which is from Exabyte.

    I'm encountering saving issues on production server.
    Some resources I can save, but somes resources I can't.

    While saving below are the problem I occur :





    I'd turn off compress_js & compress_css, also delete all core cache file, flush all user permission, but I still encountering issue on saving certain documents.

    I'd find some article (http://forums.modx.com/thread/95725/cannot-save-resource-changes-in-modx-revo-2-3-2) stated that is mod_security issue, so I contacted my hosting company.

    Here is Exabyte replies :
    Kindly note that, We have not found any errors logs related with the mod_security.
    The issue was due to incorrect folder permissions and the .htaccess code.

    And here is my .htaccess files

    RewriteEngine On
    RewriteBase /modx
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


    Please let me know how to solve this issue?
    Is it need to ask my hosting company to disabled mod_security?
    Thanks! Appreciate the helps.

    This question has been answered by pohkit. See the first response.

    • 1) Did you edit the other .htaccess files inside core and manager folder?
      2) When you run phpinfo(), can you see if the server is running php as an apache process or FCGI module? Search for "FCGI". If you can find it, it's ok (but the error must be somewhere else).
        • 51474
        • 27 Posts
        Quote from: gallenkamp at Jan 03, 2016, 04:22 PM
        Did you edit the other .htaccess files inside core and manager folder?
        Nope, my other manager files remain ht.access , i just edit the root .htaccess files for friendly url settings only.
        • Sorry, I edited my post. You were too fast smiley
            • 51474
            • 27 Posts
            Quote from: gallenkamp at Jan 03, 2016, 04:22 PM
            1) Did you edit the other .htaccess files inside core and manager folder?
            2) When you run phpinfo(), can you see if the server is running php as an apache process or FCGI module? Search for "FCGI". If you can find it, it's ok (but the error must be somewhere else).
            I run phpinfo and my apache is running 'FCGI' , could it be the error is from plugins / module?

            I'm using :
            MIGX, Ace Code Editor and some snippet plugin downloaded from modx installer.
            • What is different about the resource you can save and those you cannot save. Can you save one of the resources that you cannot save if you remove all other MODX tags from it? Do they share a template? Or do their templates share a snippet or a chunk?
                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
                • 51474
                • 27 Posts
                Quote from: sottwell at Jan 03, 2016, 04:33 PM
                What is different about the resource you can save and those you cannot save. Can you save one of the resources that you cannot save if you remove all other MODX tags from it? Do they share a template? Or do their templates share a snippet or a chunk?

                Hello, I found out the core issue that why some resources can save, some can't.

                When my resources content have this
                javascript:void(0);
                code, my resource will then cannot save it & encounter javascript error as attached.

                Resources that can't save :
                  <div class="cont-cta">
                    <a href="javascript:void(0);" id='back-to-top' class="btn btn-top">BACK TO TOP</a>
                  </div>
                



                Resources that can save :
                  <div class="cont-cta">
                    <a href="" id='back-to-top' class="btn btn-top">BACK TO TOP</a>
                  </div>
                


                May i know why is javascript:void(0) will trigger error? What if my HTML content needed this code?
                Any problem to solve the javascript:void(0) issue? Thanks alot.
                • That's a mod_security issue. Your hosting provider is full of baloney.
                  Here is Exabyte replies :
                  Kindly note that, We have not found any errors logs related with the mod_security.
                  The issue was due to incorrect folder permissions and the .htaccess code.
                    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
                    I agree with Susan. That's almost certainly a mod_security issue.

                    You might be able to get around it with a JS function and an onClick function. That way you wouldn't need the href. Something like this (untested).

                    <script type=text/javascript>
                    function scrollTop() {
                        window.scrollTo(0, 0);
                    };
                    </script>
                    
                    /* ... */
                    
                    <input type="button" class="cont-cta" onClick="scrollTop();" value="BACK TO TOP" />


                    If you still have the problem, you can put the JS in a chunk (which, hopefully, you can save).

                    I'm not very impressed by your host, though, so you might want to consider one of these: http://bobsguides.com/modx-friendly-hosts.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
                    • discuss.answer
                      • 51474
                      • 27 Posts
                      Hi guys, thanks for the answer, appreciate the helps.
                      I'd contacted Exabyte ask them to disabled the mod_security, and now my modx application is running smooth already.