I am attempting to port a PHP site produced by another coder (who's no more around) and I am getting an issue with the Apache Rewrite rules that are compelling personal files download around the target server. I am sure this can be a simple problem, but I am getting some difficulty Searching a solution. I am running on the (devoted) Ubuntu Server having a standard installing of Apache and PHP5 and porting from shared a shared server where everything runs fine. No site files happen to be changed throughout the main harbour.

The .htaccess file consists of this code (only)

# Use PHP5 as default

AddHandler application/x-httpd-php5 .php

Options -Indexes FollowSymlinks

RewriteEngine on

RewriteRule ^html/(.*)     /index.php?init=site/$1/$2/$3/$4/$5/$6/$7/$8/$9

RewriteRule ^mykart$     /index.php?admin=true

RewriteRule ^mykart/$   /index.php?admin=true

RewriteRule ^mykart/(.*)$   /index.php?init=admin/$1/$2/$3/$4/$5/$6/$7/$8/$9&admin=true

After I attempt to open the file http://www.mysite.com/html/#home the browser tries to download the (index.php) file rather than exhibiting it, using the message

"You've selected to spread out [dialog shows blank space here]

the industry: application/x-httpd-php from.... "

I suppose I have to have skipped something either in the PHP or Apache configuration, but what?

EDIT: To explain, the server is running Apache2 and it has several, functioning, PHP sites onto it. In addition basically remove the .htaccess file and operate a simple phpinfo display page everything runs fine, therefore it is not the execution of PHP per see.

I guess the MIME type application/x-httpd-php5 isn't valid. I’ve attempted it on my small local machine also it triggered exactly the same behavior.

Perhaps you have attempted application/x-httpd-php rather?

Appears like an Apache config problem, obviously I possibly could be wrong. Perhaps you have checked httpd.conf for an additional lines:

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType text/html       php