Does this happens 100% of the time you access your domain? Did you modify .htaccess file or is there any .htaccess file in the path?
This is very strange because the error is triggered from the db connection class, which is called from everywhere, there should not be url distinction