Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .HT403禁止进入_Php_Html_Apache_.htaccess - Fatal编程技术网

Php .HT403禁止进入

Php .HT403禁止进入,php,html,apache,.htaccess,Php,Html,Apache,.htaccess,这是我的HTML文件: <html lang="en"> <body> <h1>This is the HTML file.</h1> </body> </html> 加载test.html时出现错误: 禁止的 您没有在此服务器上访问/modul-1-froland/rewrite_test/test.html的权限 而不是加载我的test.php文件。你知道我该怎么修吗?使用MAMP()您的规则规定您的URL必须以tes

这是我的HTML文件:

<html lang="en">
<body>
<h1>This is the HTML file.</h1>
</body>
</html>
加载test.html时出现错误:

禁止的

您没有在此服务器上访问/modul-1-froland/rewrite_test/test.html的权限


而不是加载我的test.php文件。你知道我该怎么修吗?使用MAMP()

您的规则规定您的URL必须以
test.html
开头,开头必须有一个可选的
/
,但是您正在访问
/modul-1-froland/rewrite\u test/test.html
,它不是以
test.html
开头的

换成

RewriteEngine On
RewriteRule test.html$ test.php [L]

要匹配所有以
test.html

结尾的URL,请告诉我您正在尝试做什么,以及您正在尝试使用什么。这只是一个简单的例子,我想学习.htaccess文件是如何工作的。在这个简单示例的开头,您的
.htaccess
是否在服务器根目录中?还启用了mod_重写吗?您的站点配置是否允许覆盖?还要检查以对我文件夹中的.htaccess rules..htaccess文件(其中是test.php和test.html)运行快速测试。在网站上进行了测试,看起来很有效,但在我的本地主机上没有。也许mod_重写被禁用了
RewriteEngine On
RewriteRule ^/?test.html$ test.php [L]
RewriteEngine On
RewriteRule test.html$ test.php [L]