Forum Moderators: phranque
http://www.site.com/category/foo and
http://www.site.com/year/month/day/keyword_or_title It works great. I have this in my .htaccess file so that the files without an extension get shoved out as HTML:
DefaultType text/html Now, how do I send these files to PHP? I can't get it with the conventional AddHandler because there aren't any file extensions to add.
Thanks!
If I understand what you're trying to accomplish, something like this might work:
Options +FollowSymLinks
RewriteEngine on
# If not a directory and no file extension, rewrite to php script
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_FILENAME}/!-d
RewriteRule !\. /your_php_script.php [L]
You do not need to set the MIME type to php; The MIME-type returned to the client browser should reflect the type of *content* it returns, i.e. usually text/html, not the type of script your are using.
Ref: Apache mod_rewrite documentation [httpd.apache.org]
Jim