The intention of these rules is, as you suggested, to allow someone to request a page without including the PHP extension. So if you had a file on example.com called about.php then someone would be able to use the URL http://example.com/about in order to access it.
However if someone requests http://example.com/about.php directly you don't want it to be rewritten as http://example.com/about.php.php. Similarly, you don't want requests for images, CSS stylesheets etc to be rewritten. This is where the 2 RewriteConds come in, they are conditions saying that the rewriting should only take place if the request doesn't match a file (!-f
) or directory (!-d
) that actually exists on the site.
To answer why you're getting a 500, this could be because the permissions in Apache are configured not to allow rewrite rules in an htaccess file or one of several other reasons. Check the end of your error_log to see if there are any messages in there.