Forum Moderators: phranque

Message Too Old, No Replies

Apache configuration problems with .html files

Apache configuration problems with .html files

         

richiebman

11:28 pm on Sep 30, 2006 (gmt 0)

10+ Year Member



I had opened a previous topic that is similar to this one, but the problem has slightly changed (and closed). Old topic:

[webmasterworld.com...]

Now what I want to do is parse PHP in .html files which works well so far. However now I want to use mod_rewrite to clean some of my urls. I've tracked it down to this bit in the apache config file:

<Directory "D:/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

If AllowOverride is set to 'None', php is parsed in .html files but mod_rewrite doesn't work and throws up a 404 error (presumably because it is ignoring the rewrite comments in the .htaccess file).

But if AllowOverride is set to 'All', mod_rewrite works for .php files but any url called with .html extension I get a 403 error like in my previous post.

To me this is bizarre and I have no idea what to do.

Ta,
R

richiebman

6:19 pm on Oct 1, 2006 (gmt 0)

10+ Year Member



Well this is embarrassing. I resolved the problem after I looked in my devsite root (where all my websites root folders are) and noticed a .htaccess file in there. It was about 2 years old and had some "AddHandler cgi script .html" thing in that I don't use anymore which was affecting all .html files as it filtered though all my devsites.

Deleted and now fine. Doh!

jdMorgan

9:55 pm on Oct 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad to hear that!

After reading this thread several times, I couldn't come up with anything better than "Try asking in the PHP forum," but I thought I'd leave it until Monday when traffic picks up again, and you'd have a better chance at getting a response.

Jim