You can also do it in your .htaccess file if you are using an Apache server. I'll let the Apache experts (of which I'm not one) explain that.
Jason's right about what the "textbook" says about how to do it in PHP. I'll tell you, though, there are some versions of PHP in which that doesn't work. It was a bug in the code. The bug supposedly was fixed in an earlier version but it seems to have cropped up again. My version 4.3.6 still shows the error with IIS 6.0.