Changes in .htaccess not taking

Compaq ?
May 9, 2010 at 16:40:43
Specs: Windows 98/Windows 7/Mac OS X, ?
I've added the following lines to my .htaccess file:

AddType application/x-httpd-php .html .htm
AddHandler application/x-httpd-php .html .htm

So that I can use php in my .html files. I don't know if having two methods for the samething is affecting it, but I did this 'cause im not sure how my server handles php (im not the admin). But it doesn't work. Any suggestions?

See More: Changes in .htaccess not taking

Report •

May 9, 2010 at 18:10:10
I rewrote it to
RemoveHandler *.html *.htm
AddType text/plain *.html *.htm
AddType application/x-httpd-php *.html *.htm

It still doesn't work, and now no html file works. When I go to my site, all internet browsers attempt to download the file, but when I go to, it works fine (except the php). How can I get back the redirect thingy?

Report •

May 9, 2010 at 22:02:01
I had the same issue, but after searching for hours on end, I found this:

RemoveHandler *.html *.htm
AddType text/html *.html *.htm
AddType application/x-httpd-php *.html *.htm *.php
DiectoryIndex index.html index.htm index.php

Add this code into your .htaccess file.

Report •

August 19, 2010 at 21:34:00
As already stated by (macaswell May 9, 2010 at 22:02:01 Pacific)....

You should tell apache which file it should treat as default when someone attempts to requests a directory(may be home page).

DiectoryIndex is the way to do that. Any file name after "DiectoryIndex" would be opened, if not found the second file should be opened, if that too not found then third.

It would suggest you too secure your . htaccess from accidently being shown also.
Check this

Report •
Related Solutions

Ask Question