使用php阻止url指定的文件夹或路径
我有一个块指定的路径。使用php阻止url指定的文件夹或路径,php,url,path,Php,Url,Path,我有一个块指定的路径。 例如http://example.com/image 或http://example.com/file.php 有人去这个路径,它需要显示你没有权限或重定向另一个页面。。如何为Php实现这一点。。给我举个好例子 您可以在每个要阻止直接访问的目录中添加index.php文件。Inside index.php添加 echo "<script>location.href='your_redirect_path';</script>"; or head
例如http://example.com/image 或http://example.com/file.php 有人去这个路径,它需要显示你没有权限或重定向另一个页面。。如何为Php实现这一点。。给我举个好例子 您可以在每个要阻止直接访问的目录中添加index.php文件。Inside index.php添加
echo "<script>location.href='your_redirect_path';</script>"; or
header("Location: your_redirect_path");
exit;
你已经试过什么了?