我尝试在 apache app/index.php/admin/authentication/sa/login 上阻止此 URL,并在 httpd.conf 文件中添加以下文本:
<Directory "/var/www/html/">
AllowOverride none
Order Deny,Allow
Deny from all
Allow from Some IP from internal network
</Directory>
但它不起作用,我不明白映射。实际上 URL 没有映射文件夹、文件。
drwxrwxr-x. 2 apache apache 40 May 26 13:22 admin
drwxrwxr-x. 15 apache apache 256 Mar 2 12:58 application
drwxrwxr-x. 7 apache apache 102 Mar 2 12:58 assets
-rwxrwxr-x. 1 apache apache 15202 Mar 2 12:58 buildVueComponents.js
-rwxrwxr-x. 1 apache apache 1340 Mar 2 12:58 composer.json
-rwxrwxr-x. 1 apache apache 3275 Mar 2 12:58 CONTRIBUTING.md
drwxrwxr-x. 5 apache apache 180 Mar 2 12:58 docs
drwxrwxr-x. 19 apache apache 4096 Mar 2 12:58 framework
drwxrwxr-x. 2 apache apache 37 Mar 2 12:58 html
-rwxrwxr-x. 1 apache apache 6615 Mar 2 12:58 index.php
drwxrwxr-x. 5 apache apache 73 Mar 2 12:58 installer
-rwxrwxr-x. 1 apache apache 49473 Mar 2 12:58 LICENSE
drwxrwxr-x. 102 apache apache 4096 Mar 2 12:58 locale
-rwxrwxr-x. 1 apache apache 80 Mar 2 12:58 manifest.yml
drwxrwxr-x. 4 apache apache 31 Mar 2 12:58 modules
-rwxrwxr-x. 1 apache apache 62 Mar 2 12:58 package.json
-rwxrwxr-x. 1 apache apache 1140 Mar 2 12:58 phpci.yml
-rwxrwxr-x. 1 apache apache 468 Mar 2 12:58 phpunit.xml
drwxrwxr-x. 3 apache apache 36 Mar 2 12:58 plugins
-rwxrwxr-x. 1 apache apache 1378 Mar 2 12:58 psalm.xml
-rwxrwxr-x. 1 apache apache 2742 Mar 2 12:58 README.md
drwxrwxr-x. 9 apache apache 4096 Mar 2 12:58 tests
drwxrwxr-x. 5 apache apache 49 Mar 2 12:58 themes
drwxrwxr-x. 37 apache apache 4096 Mar 2 12:58 third_party
drwxrwxr-x. 6 apache apache 107 Jun 12 12:51 tmp
drwxrwxr-x. 10 apache apache 139 Mar 2 12:58 upload
-rwxrwxr-x. 1 apache apache 360 Mar 2 12:58 yarn.lock
我如何阻止不存在的 URL 作为映射/var/www/html/application
。我没有任何文件夹index.php/admin/authentication/sa/login
。index.php
是文件,而不是目录
答案1
看起来 Location 标签处理未映射的 URL 请求。因此,它适用于以下代码,但以下代码不允许 IP 访问页面。我做错了什么吗?
<Location "/index.php/admin/authentication/sa/login">
AllowOverride none
Order Deny,Allow
来自所有
拒绝 来自 10.10.10.10
允许 </ Location>