Cruft-free URLs with PHP

08 August 2004 11:25 AM (4 years ago) | Filed under live

I ran into a bit of an issue while I was implementing Mark Pilgrim’s Cruft-free URLs in Movable Type on this site, in that I am lazy and all of my files generally have PHP includes instead of old-style Apache #include inline directives. In short, adding the directive DefaultType text/html to my .htaccess file in the root directory had some nasty side effects.

In short, suddenly every page with inline PHP commands was broken. The PHP was never being parsed because, yep, all files without an extension were defaulting to content type text/html. Not the best thing in the world.

To fix this, I changed the content type of the directive to reflect the use of PHP on my site, as follows.

DefaultType application/x-httpd-php

It worked like a charm.

Comments on "Cruft-free URLs with PHP"

Leave a comment | Trackback | Comments feed (RSS 2.0)

Sorry, there are not any comments on this entry yet. Would you like to leave a comment?

Leave a reply



XHTML: You may use these tags:

This entry was written 4 years ago. You may want to use the search function for a more recent entry on this topic.

Copyright © 2003-2008.
Entries (RSS) | Comments (RSS).
XHTML 1.0 Strict, CSS, RSS, 508.