1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
What extension should I use for CGI scripts?
When you use CGI scripts, they can end in .cgi, .pl, .php, .php3, php4 etc. and may be located anywhere on the server (there is no need for them to be in the cgi-bin directory visible via FTP).
Link to this FAQ: