« 301 Permanent Redirect PHP and HTACCESS || PHP: Autolink Text – Twitter @replies »

Masking PHP via .htaccess

1


What we're doing: turning the .php extension into .whatever
Why we're doing this: security, seo, or because you want to (then you'll have to answer why for yourself)
How to do this:

In your .htaccess file, we're going to tell apache to parse your choice of a single or multiple .whatevers as php.
So if we wanted to parse .html files as php, we would do something like this:

AddType application/x-httpd-php .html

And if we wanted to parse .bunnyboyfoofoo files as .php:

AddType application/x-httpd-php .bunnyboyfoofoo

And if we wanted to parse .bunnyboyfoofoo, .html, .htm, .py, .kevinsmith, .google files through php:

AddType application/x-httpd-php .bunnyboyfoofoo .html .htm .py .kevinsmith .google

Simple and fun to play with if you're that type of person.

PS:  Sorry it has been so long since my last update...it's summer, I've been enjoying it.


This entry was posted on Tuesday, July 22nd, 2008 at 12:34 am and is filed under Blog, PHP, WebDev. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Get a Trackback link

1 Trackbacks/Pingbacks

  1. Pingback: 304blogs on August 18, 2008

Leave a comment