Archive for the ‘Apache’ Category

Using .htaccess to Parse HTML Files as PHP

Friday, October 10th, 2008

I receive this question quite frequently by readers who want to know how to configure Apache to treat HTML files as if they were PHP. Parsing HTML files as PHP can be quite handy if you have a current HTML site that you’re moving over to PHP and you don’t want to have to […]

Force a File to Display Instead of Executing

Monday, November 5th, 2007

If you’re like me, you run a site written in PHP. Sometimes I offer PHP scripts to my readers and want them to be able to download them, but if I post a link, the script is executed instead. You can prevent this action with a small .htaccess tweak.

Force Files to Download Instead of Opening

Monday, November 5th, 2007

Have ever wished that you could force a file to download instead of opening in a browser? Some common files like MP3s and PDFs will open in your reader’s browser if the proper parent plugin is installed. Sometimes you want to force them to download the file without having to right-click and save […]

Creating a Catchall Subdomain in Apache

Wednesday, July 11th, 2007

Let’s assume for a minute that you have a dynamically created site. You have an unknown amount of users creating accounts on your site. Each user account is created in a subdirectory on your site and you would like to provide your users with a subdomain for their account. In other words, […]