We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4168
    • 11 Posts
    Hello, all...

    I searched the forums for this, so my apologies if this has been covered already. According to my host’s documentation, mod_rewrite is active by default (although I’ve submitted a support ticket to make sure). When I enable .htaccess, I get the following when I load the site:

    500 Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator www@ and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    Reason: Error parsing access file

    I’m pretty sure the .htaccess file is correct. The installation is in a subdirectory called "_staging" so:

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


    , although I have tried it a number of ways to no avail. Every so often it throws a slightly different error (which I didn’t think to copy... sorry!) to the effect that RewriteBase is not recognized.

    Thoughts?
      • 4310
      • 2,310 Posts
      I don’t think you’d normally add /staging/ to the actual RewriteRule as it’s declared in the RewriteBase
        • 4168
        • 11 Posts
        Quote from: bunk58 at May 21, 2008, 05:51 PM

        I don’t think you’d normally add /staging/ to the actual RewriteRule as it’s declared in the RewriteBase
        Thanks for responding!

        OK, nixed the "/_staging/" but still no dice. I’m getting the same error.

        (Getting rather impatient with my host. Submitted my ticket 3 hours ago. *grumble*)
          • 18367
          • 834 Posts
          Thanks bbloke

          Tried it your way and still get the same result. Thing is if I replicate the offending page and then rename it it works fine (which is probably the best solution right now.)

          As for the extra "/" can’t seem to figure out where it is, but removing it from the address bar when I type in the url seems to work ok, so at this stage it’s more of a niggle than a critical issue. ’Tis annoying though. Thanks for your help again.




          I’m guessing on this one but you could check the template for this:
          Code:

          <base href="[(site_url)]" />


          Also check you .htaccess (this is mine)
          Code:

          RewriteEngine On
          RewriteBase /modx/

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


          See if that helps.


            Content Creator and Copywriter
            • 18367
            • 834 Posts
            Brundlefly,

            if you’re getting the 500 error, it should mean that rewrite mod is set up, it’s just not working as it should, which is probably something in the actual .htaccess file.

            One trap to look out for is that you actually save the .htaccess file as an .htaccess file and not a txt file. Catches everyone out all the time.

            Apologies if you already know this, but it may help others as well. Check the extension of the file if it says txt, you’ll have to recreate it.

            It should look like this Filename: .htaccess Type: HTACCESS File

              Content Creator and Copywriter
              • 4168
              • 11 Posts
              Thanks, markg

              No, it’s definitely a .htaccess file.

              ~b
                • 4168
                • 11 Posts
                Just checked the error log:

                [Wed May 21 20:27:58 2008] HTTPd: syntax error or override violation in access control file [SERVER]/web/_staging/.htaccess, reason: Unknown method RewriteBase

                So... mod_rewrite is set up, but it doesn’t recognize RewriteBase? Wha...?
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Try just removing RewriteBase and make sure your Apache config allows you to override mod_rewrite directives in .htaccess files (this is a common source of a 500 error even if mod_rewrite is setup).
                    • 4168
                    • 11 Posts
                    Try just removing RewriteBase and make sure your Apache config allows you to override mod_rewrite directives in .htaccess files (this is a common source of a 500 error even if mod_rewrite is setup).

                    I tried removing RewriteBase but got:

                    error parsing access file [server]/web/_staging/.htaccess, line 1, reason: unknown Directive

                    I still haven’t gotten a reply from the hosting company (just sent a new message), but if I ever do I’ll ask them about the Apache config. The thing is, their documentation seems to say that you can...

                    ~b

                    P.S. From the host’s support page: "We will quickly respond with a ticket number to help you track your request." Close to 24 hours later, no ticket number... *shakes fist*
                      • 4168
                      • 11 Posts
                      Ok... problem resolved... somehow. I finally heard from the host. They said that "RewriteRule" and "RewriteCond %{REQUEST_FILENAME}" are the only operators supported. On a whim I tried deleting RewriteBase once again, same as before... and this time it worked! I’m thinking they quietly fixed the configuration or something. Weird.

                      Many thanks for all your help!

                      ~b

                      This discussion is closed to further replies. Keep calm and carry on.