We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5143
    • 116 Posts
    The site I’m currently working on has been a little quirky when it comes to rendering css - Firefox would usually parse it ok, but Chrome and IE were having none of it.

    For this reason, and a number of others, I figured it was time to start using FURLs - I knew the client would want them anyway.

    I’ve followed the instructions here http://rtfm.modx.com/display/revolution20/Using+Friendly+URLs - or at least I think I have - but this only ever results in a 500 Internal Server Error. I’ve been able to getting it working in the past (somehow) on another computer, but despite copying the settings over as best I can, nothing seems to work.

    I’m running Windows XP with the latest version of WAMP and am using MODx Revolution 2.0.7 and am developing on localhost. Oh, and quite importantly, the 500 error only started happening when I renamed ht.access to .htaccess

    Does anyone have the foggiest what’s going on?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There’s a rule in there that your server doesn’t like. Try commenting out everything, then uncomment line by line until you find out which one it’s objecting to. This is the important part for friendly URLs:
      RewriteEngine On
      RewriteBase /
      
      # For Friendly URLs
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      

      I’ve had 500 errors on some servers if the RewriteEngine was already set to On in a parent directory. And make sure you WAMP has mod_rewrite enabled for Apache. Some .htaccess files have a conditional block for the rewrite rules, while friendly URLs won’t work, at least it won’t cause 500 server errors:
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      
      # For Friendly URLs
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      1 [L]
      </IfModule>
      
      <IfModule !mod_rewrite.c>
          ErrorDocument 404 /index.php
      </IfModule>
      
        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
        • 5143
        • 116 Posts
        Hi Susan, thanks for the reply.

        All lines are already commented out, except for the ones you’ve highlighted, which read as follows:

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


        When I commented everything out, including the above, uncommenting any single one of them would result in a 500 error.

        The .htaccess file is in the modx directory along with the index.php file.

        I’m thoroughly stumped!

          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Well, does your WAMP installation have mod_rewrite enabled?
            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
            • 5143
            • 116 Posts
            It does - it’s just the httpd.conf file that needs the line uncommenting right?

            Edit : all it needed was an Apache restart. I can’t believe how much hair I’ve lost the afternoon trying to get this working. Thanks for your time Susan - and sorry for wasting it.

            There still seem to be issues rendering any css though - as before, Firefox is fine, but any other browser simply won’t have any of it.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Friendly URLs have nothing to do with css in any case. Have you tried validating the pages, both HTML and CSS validation? Sounds like you have a picky error somewhere in the HTML or CSS and FF is being forgiving while the others are not.
                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