Prevent page from loading

I setup a php script to be run through a cron job. But i want to make it so that if someone simply typed in the page address they would not activate that script and then the page would redirect them to index.html. Any help is appreciated.
Thanks