Custom Filenames Using Apache
June 23rd, 2009If 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