Link to home
Start Free TrialLog in
Avatar of vzorn
vzornFlag for United States of America

asked on

htaccess php problems

I have inherited a site build using php.  The actual files are html and the htaccess file I believe tells the server to run the html files as php files.  Here is the code:

AddType application/x-httpd-php .html .htm .php .inc
XBitHack full

Options +FollowSymLinks

<IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^([^/]+).faq$ content.php?id=$1
      RewriteRule ^([^/]+).news$ content.php?id=$1
      RewriteRule ^([^/]+).blog$ content.php?id=$1
</IfModule>

I had to get a new server.  It is LInux and I am using a Plesk interface.
I have created all the sites.  We have not changed the DNS until the sites are finished.
I cannot view the sites.  As soon as I put in the IP address the browser tries to download the index.html file.  
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Try adding this to your .htaccess file.
AddType application/x-httpd-php5 .html .htm .php

Open in new window

Avatar of vzorn

ASKER

I took out everything and just added the one line.  
It tries to download the index.html file still.
Avatar of vzorn

ASKER

my phpinfo does not display the Apache information.
My hosting company keeps telling me it is running on the server.
I am using a Plesk interface
Does the downloaded file contain PHP code?

Actually, try creating a file like "info.php" and putting this in it:
<?php
phpinfo();

Open in new window


Go to the PHP script directly.  If it tries to download, PHP isn't enabled; if it works (and you get information about PHP), then the problem is something with content type.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vzorn

ASKER

Yes PHP is working, I get all of the phpinfo details.  
My hosting company is hostgator, we have VPS.
I will ask them to restart the server.

Hmm... Hostgator is pretty good about stuff like that.  What is the URL of your index.html?  Is the .htaccess script in the same directory?
Avatar of vzorn

ASKER

Hostgator has fixed the issue. They restarted the server.  I am not sure if they did anything else.

thank you for your help!
Yeah, too bad you can't fix my car that way!  Thanks for the points, ~Ray