Processing HTML Pages As PHP

Phillip created popular HTML pages that I wanted to add PHP code to, to track the number of hits they’ve been getting. I didn’t want to change the file’s extension or use redirection, so I wondered if it was possible for Apache to treat HTML files as PHP files; it is: add the following to your httpd.conf file: AddType application/x-httpd-php .htm AddType application/x-httpd-php .html Works like a charm. You could

Preventing Image Bandwidth Theft Using Apache

I recently noticed this site’s images were getting a lot of hits – only the images, not the pages they were posted to. I discovered a lot of users of forums and chats linking directly to the images on this site, instead of copying the image and hosting it on their own website. This type of image linking is a drain on my poor server, and it’s considered bandwidth theft.