We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1663
    • 2 Posts
    Hi, im just wondering if someone could maybe help me. I have installed modx, everything is fine, but when trying to run a cgi script, i am getting a 404error.
    Even when i try run a a cgi script that is outside modx, i get my modx 404.
    My host provider has been amazing and has tried to help, thinking maybe it was a server side problem, but it appears to be the .htaccess file that is affecting the cgi scripts. The .htaccess file is also affecting my forums, if gzip compression is turned on, i now get an error, the gzip part is controlled in the .htaccess too.
    I was told by another modx user that a rule could be written to tell modx to ignore certain directories and the cgi bin, could anyone please tell me how to do this ? thankyou kiss

    Web Server: = Linux
    ----------------
    PHP version = 4
    MySQL version = mysql (4.0.25-standard)
    Operating System and version = RH9
    • The .htaccess file is only used if you enable friendly URLs. You can remove it and use MODx without it, or you can comment out the gzip rules and just use the rewrite rules. I’m not sure why the rewrite rules would be affecting CGI scripts so long as they are actual file names that exist on the server (i.e. not URLs to virtual resources that are supposed to be interpreted).
        • 263
        • 52 Posts
        Hi Angel!

        I’m sure MODx is not in the slightest bit interested in your CGI bin! You can put a .htaccess file in any directory and its directives will override those higher up the tree. So for example, php_flag zlib.output_compression off and RewriteEngine off in .htaccess of your forum root might sort things out.
        Cheers
        • Actually though, we are interested in conflicts with CGI bin apps.

          Try this:

          If your app that’s having a bad time of it is in another directory, create an .htaccess file in that directory with the same content as the one in the manger directory:

          RewriteEngine Off


          Please let us know if that works for you. Thanks smiley
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 263
            • 52 Posts
            @rthrash: By MODx not being interested I meant MODx the bits and bytes; the 1s and 0s.... NOT MODx the team cool
              • 12879
              • 13 Posts
              Quote from: rthrash at May 09, 2006, 01:28 AM

              Actually though, we are interested in conflicts with CGI bin apps.

              Try this:

              If your app that’s having a bad time of it is in another directory, create an .htaccess file in that directory with the same content as the one in the manger directory:

              RewriteEngine Off


              Please let us know if that works for you. Thanks smiley

              I think this may work, I’m having a similar problem and will try this. It has to do with the alias paths, so anything that is a real url to a real file as opposed to a MODx entry is throwing the MODx 404. I’m also using subsites which may be complicating matters a lil but the premise is the same. Will post back either way once I throw some htaccess files around.

              ---Indie
              • If you are using 0.9.2.1 and applied the subsites hack overtop of it, you may have more problems that .htaccess, because the core files which were modified for the subsites hack changed quite a bit in 0.9.2 and I’m not sure the subsites hack has been updated and applied to it properly.
                  • 1663
                  • 2 Posts
                  I tried the solution offered, and had help from another modx user just in case i was doing something wrong.
                  Unfortunatlely it diddn’t work and my cgi scripts still wont run.

                  I am linking to the cgi from a modx page.

                  Pasting a *direct* link to the cgi file into another browser that has no cache of the modx site still somehow gets the modx 404

                  Is there anything else i can do ? turning off friendly url’s isn’t an option as i have 300+ pages all linked via friendly url’s and alias paths.

                  I would be grateful for any help or suggestions smiley
                  • If the cgi script is a file on the server, the rewrite rules should not catch it, so something else is at work here, but unfortunately without more knowledge of your environment and scripts, I’m not sure what else to try. Adding to or modifying the rewrite rules to specifically handle the cgi script URL might be another approach, though that really shouldn’t be necessary.