Php 访问路径时将用户重定向到错误页面
我在我的“app”文件夹中有一个.htaccess,我想要的是,如果任何用户试图访问该目录,那么他们将被重定向到错误页面。这是.htaccess中的内容: 我的完整目录是:Rummage/app/view/errors/404.phpPhp 访问路径时将用户重定向到错误页面,php,apache,.htaccess,mod-rewrite,redirect,Php,Apache,.htaccess,Mod Rewrite,Redirect,我在我的“app”文件夹中有一个.htaccess,我想要的是,如果任何用户试图访问该目录,那么他们将被重定向到错误页面。这是.htaccess中的内容: 我的完整目录是:Rummage/app/view/errors/404.php my.htaccess位于应用程序文件夹中:Rummage/app/.htaccess ErrorDocument 404 /pages/errors/404.php 它似乎不起作用。我的Rummage/public上还有另一个.htaccess,它是一个干净的
my.htaccess位于应用程序文件夹中:Rummage/app/.htaccess
ErrorDocument 404 /pages/errors/404.php
它似乎不起作用。我的Rummage/public上还有另一个.htaccess,它是一个干净的url.htaccess。它可以工作,但出现错误。htaccess无法在应用程序文件夹上工作
/app/.htaccess
.htaccess
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+app/[?\s] [NC]
RewriteRule ^ /app/view/errors/404.php [L,R=404]
什么是您的
DocumentRoot
以及404.php
的完整URL是什么?您好,很抱歉提出这个问题,但您所说的DocumentRoot是什么意思?DocumentRoot
是您的站点根路径htdocs/Rummage/是吗?