【发布时间】:2016-12-16 11:53:51
【问题描述】:
这是我的 HTML 文件:
<html lang="en">
<body>
<h1>This is the HTML file.</h1>
</body>
</html>
PHP 文件:
<?php
echo "<h1>This is the PHP file.</h1>";
?>
.htaccess 文件:
RewriteEngine On
RewriteRule ^/?test.html$ test.php [L]
当我加载 test.html 时出现错误:
禁止
您无权访问此服务器上的 /modul-1-froland/rewrite_test/test.html。
而不是加载我的 test.php 文件。知道我该如何解决吗?在 MAMP 中工作 (http://localhost/modul-1-froland/rewrite_test/test.html)
【问题讨论】:
-
我想知道你想要做什么以及你想要做什么。 htaccess?
-
这只是一个简单的例子,我想了解 .htaccess 文件是如何工作的。以这个简单的例子开头