WebHead Help
I’m not looking for Spiderman. Unless he’s got an IT diploma. We’re 99% (I say we and I really mean Ray) implementing a redesign of my site, but we’ve been pipped at the post by some .htaccess tomfoolery. Ray has articulated the particular problem on his site, so if you’re inclined to Apache and generosity, take a look.
6 Responses to “WebHead Help”
The links in your post are broken.
I hate to be that guy, but they work for me. The link is: http://www.vanderwoning.ca/archives/2004/12/21/476.html.
Your installation of Apache should have mod_rewrite installed. If so it should as straightforward as adding the following to the .htaccess file:
RewriteEngine On
RewriteRule ^index.html index.php
Just the AddType has always worked for me ( AddType application/x-httpd-php .html ).
It sounds as though there’s a conflicting directive, perhaps gzip compression on html that isn’t PHP aware or something? I’m just guessing, would be impossible to know without seeing the complete conf files.
I wouldn’t use the mod_rewrite hack for it (would that even work instead of AddType, I don’t think it would execute the PHP code), you’d want all .html to be able to include PHP.
mod_rewrite does work for this, if you want a general rule to support XXX.html -> XXX.php simply use the following rule:
RewriteRule ^(.*).html $1.php
Ugh, now I really have to say something. mod_rewrite has significant overhead, it’s a bad bad idea to rewrite every URL on a site with a fair amount of traffic. It’s intended for the occasional quick fix, not a workaround like this. It would be far better to fix the problem the Right Way ™.
Comments are closed.