Silverstripe 3 adding index.php to URLs

Had a problem where Silverstripe was adding index.php to all URLs which was a pain in the ass.

Instead of my URLs being:

http://localhost/mysite/httpdocs/mypage

They were:

http://localhost/mysite/httpdocs/index.php/mypage

I had a look in the root index.php on my site, and found a line:

define('BASE_SCRIPT_URL','index.php/');

changing this to:

define('BASE_SCRIPT_URL','');

Fixed this issue.