On Mon, Apr 4, 2011 at 3:50 PM, JR Gregorio <[email protected]>wrote:

> > > AddType application/x-httpd-php .php .htm .html
>
> That was one of the solutions that forced the browser to download the
> page.
>
> Is restarting Apache necessary for the AddHandlers to take effect? Not
> that have the capability to reload Apache since I only have basic FTP
> access into the site.
>
>
I'm wondering if you need to specify a mime type at all. Naive question, but
can you not leave the type as html & just add a handler for it? I'm thinking
back about 10 years now, but I recall getting the shtml handler to work on
.html files without playing with mime types.

Another option is do you have a hosting control panel? DirectAdmin has
screens for entering handlers & mime types for hosted domains. Its
competitors may also support this sort of feature.

If all else fails, can you just rename some of the .html files to .php? I
have a legacy site that I changed from .html to .php recently and used the
following .htaccess file from
http://httpd.apache.org/docs/current/misc/rewriteguide.html (update at
http://httpd.apache.org/docs/2.3/rewrite/remapping.html ) to fix the
.html->.php conversion for the files I chose to rename.

#   backward compatibility ruleset for rewriting document.html to
document.php
#   when and only when document.php exists but no longer document.html
RewriteEngine on
RewriteBase   /
#   parse out basename, but remember the fact
RewriteRule   ^(.*)\.html$              $1      [C,E=WasHTML:yes]
#   rewrite to document.php if exists
RewriteCond   %{REQUEST_FILENAME}.php -f
RewriteRule   ^(.*)$ $1.php                   [S=1]
#   else reverse the previous basename cutout
RewriteCond   %{ENV:WasHTML}            ^yes$
RewriteRule   ^(.*)$ $1.html

HTH
-- 
Bruce Clement

Home:    http://www.clement.co.nz/
Twitter:    http://twitter.com/Bruce_Clement
Directory: http://www.searchme.co.nz/

"Before attempting to create something new, it is vital to have a good
appreciation of everything that already exists in this field." Mikhail
Kalashnikov

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to