September 8th, 2002, 03:20 AM
More custom PHP extensions
Well, I got a msg asking me to show how to use a .htaccess file for custom php extensions. Well it is very simple. There is also a very good reason for using .htaccess for this.
With many servers, it is possible to add custom extensions, I use quite a few servers and I make my own extensions, usually to trick others, maybe .cowtippingisthesportofchampions or something like that. Anyways, there are 2 reasons to use a .htaccess file for this.
1. Rather than go into httpd which for many newbies gives them a headache, with the .htaccess method you only need to add one line and you're done.
2. If you have an account with a web hosting company they probably won't go and change the configuration file just so you can have some odd looking page extensions.
And so if you want to do this, just add this line into the .htaccess file somewhere
So, basically, apache will parse all pages ending in .htm or .cow... through Php. Please make sure the setup of your .htaccess file is correct, or this may end up not working at all.
AddType application/x-httpd-php .htm .cowtippingisthesportofchampions
And there you have it. Now apache can be a bit of a headache when trying to configure to use other dynamic web languages, but if you do manage to do so, I see no reason why this shouldn't work, because I know that Coldfusion (CFML) pages will work in apache but I am not sure how to configure apache to parse Coldfusion pages.
September 8th, 2002, 03:42 AM
Yeah, Thanks for the follow up =)
This is useful for adding Seperate extensions for seperate users (user a has .a, userb .b, etc.)
Remember! To use this you must have AllowOverride set to All in your httpd.conf
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
September 8th, 2002, 04:11 AM
K, thanks for the info and your welcome.