Add PHP handler – URL issues with website

Hi friends,

Sometimes when we access a URL, it gets downloaded to the local machine where it not meant to be. In such scenarios, you can check the PHP handlers that mentioned in the .htaccess file of your problematic site. First you must know what’s a PHP handler, please continue reading before going to the steps.

A PHP handler defines the method that Apache uses to communicate back and forth with your PHP scripts. In order for a site to run on PHP, the server must interpret the PHP code and generate a page when visitors access the website. It interprets the code based on which PHP library you are using, such as PHP 4 or PHP 5. A PHP handler is what actually loads the libraries so that they can be used for interpretation. PHP handlers determine how PHP is loaded on the server.


  1. ssh to the server as root user
  2. Open the .htaccess file under the problematic domain using a text editor
  3. Please add the following lines at the end of the file then write quit the file and check if the issue gets fixed. Done!!
    AddType application/x-httpd-php .html .htm
    UPDATE 1
    It may be PHP version specific. If you’re using PHP5 try:
    AddType application/x-httpd-php5 .html .htm
    UPDATE 2
    RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html

Now try to access the URL and see if it works for you, thanks!!

Leave a Reply

Your email address will not be published. Required fields are marked *