Posts tagged with Apache

Custom Filenames Using Apache

June 23rd, 2009

If you look at any page on Ars Technica (like this one for example) you will see that they use an extention of ‘.ars’.

It’s very easy to set up Apache to do the same so you can use any extension you want. Even if your site is hosted elsewhere and you do not have access to the httpd.conf file you can still make the change by using the .htaccess file.

For example let’s say you want to use the extension ‘.data’ for you files, simply add this line to your .htaccess file.

AddType application/x-httpd-php .data

Now all pages called ‘.data’ will be processed by PHP. If you also use content negotiation then you will need to add ‘.data’ files you your DirectoryIndex so Apache looks for ‘.data’ files first.

It should look something like this.

DirectoryIndex index.data  index.php index.html

Enable gzip Compression in WordPress 2.5

April 4th, 2008

I only noticed today that the gzip compression option was removed from WordPress 2.5. Apparently this was done as it’s easy to acheive the same thing using mod_deflate on Apache.

The problem is that my host uses Apache 1.3 and also doesn’t have mod_gzip installed so I had no choice but to do this in PHP.

Fortunately I came across this plugin that re-enables gzipping of pages saving me bandwidth and my visitors downloading time.

Useful guide to using htaccess files

January 24th, 2008

Here’s a really helpfull guide to using .htaccess files with Apache, great for cut and paste examples for when mod_rewrite is giving you a headache.

http://www.askapache.com/htaccess/apache-htaccess.html