Wednesday, August 11, 2010

apache2, mod_rewrite, SCRIPT_URL

Recently I moved my localhost website to a virtual host, and was unable to understand the reason for missing SCRIPT_URL in the $_SERVER variable in PHP. The problem was that I forgot to insert the rewrite rule in the vhost, and the SCRIPT_URL is dependent on the rewrite engine.

So, if you are not able to find SCRIPT_URL documented in PHP, check to see if you have rewrite engine on in your website definition.