index.php下载但未在浏览器中运行

时间:2019-07-20 17:55:08

标签: php html apache

我对php的使用经验为零,我正在尝试运行一个简单的php文档,该文档引用主目录中的其他php文档。我无法在浏览器窗口中运行index.php,它只是一直尝试下载文件。

经销商服务器(我从该服务器运行许多网站,包括许多wordpress网站)是Linux,带有最新版本的MySQL,PHP和Apache。 htaccess doc工作正常。

index.php:

<!doctype html>
<html ⚡ lang="en">
    <head>
        <?php include('head.php');?>
    </head>
    <body>
        <?php include('main-content.php'); ?>
    </body>
</html>

.htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.website.com [NC]
RewriteRule ^(.*)$ http://website.com/$1 [L,R=301,NC]
DirectoryIndex index.php

0 个答案:

没有答案