Addicted to novelty since 2001

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”

  1. John Keyes

    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

  2. Rog

    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.

  3. John Keyes

    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

  4. Rog

    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.