Reputation: 703
Okay, so I have a weird one for you all today. I'm looking into creating a custom MIME type for a .php file. I've read some pro's/con's on this and it won't be for much other than some experimentation to see what can really be done. My company's initials are TTP and so we decided it'd be kinda fun to have all of our .php pages re-written to a custom .ttp extension. I've attempted my normal cPanel X route with adding it in, and I've also tried adding the change into the .htaccess file. It work's perfectly fine until I change the application type to anything php.
AddType text/html ttp // works
AddType text/x-php ttp // doesn't work
AddType application/x-php ttp // doesn't work
AddType application/x-http-php ttp // doesn't work
Some things that have come up was an issue that doing this renders the .php file and therefore makes it difficult for the browser to decide how to handle it. Any other ideas? I'm pretty sure that at the end of the day this won't be something the company will do, but they wanted to see if any experiment I could run will work.
Upvotes: 1
Views: 3315
Reputation: 799580
Handlers are specified with AddHandler
. The mod_php handler is php5-script
.
And the browser never handles PHP.
Upvotes: 0
Reputation: 163622
The browser doesn't handle PHP. Content-Type doesn't matter here.
Look at your CGI or module configuration, to configure PHP to handle more than .php. For PHP as a module:
<FilesMatch \.ttp$>
SetHandler application/x-httpd-php
</FilesMatch>
Upvotes: 1