Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.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
.htaccess .httaccess未阻止/.well-known/acme challenge/abc_.htaccess_Http - Fatal编程技术网

.htaccess .httaccess未阻止/.well-known/acme challenge/abc

.htaccess .httaccess未阻止/.well-known/acme challenge/abc,.htaccess,http,.htaccess,Http,我试图阻止通过指向/.well-known/acme challenge/abc的链接访问ssl令牌 我试图在.htaccess文件中重新写入 RewriteEngine On RewriteRule ^\.well-known\/acme-challenge\/ /404.php [R=301,L] 但是,ssl证书仍然显示,而不是在/.well-known/acme challenge/abc上执行重定向 我如何阻止访问/.well-known/acme challenge/abc? 比如

我试图阻止通过指向/.well-known/acme challenge/abc的链接访问ssl令牌 我试图在.htaccess文件中重新写入

RewriteEngine On
RewriteRule ^\.well-known\/acme-challenge\/ /404.php [R=301,L]
但是,ssl证书仍然显示,而不是在/.well-known/acme challenge/abc上执行重定向

我如何阻止访问/.well-known/acme challenge/abc?

比如:

重定向匹配403\/abc$
顺便问一下,为什么要隐藏SSL证书? 正如它所说, 您根本不需要隐藏证书。证书仅包含所有者(在本例中为服务器)的公钥和其他信息。它不应该包含任何私人信息。您需要做的是以信任证书来源的方式存储证书

快乐编码

试试看:

#turn on mod_rewrite
RewriteEngine On
#see if the url is ...
RewriteCond %{REQUEST_URI} ^\/\.well-known\/acme-challenge\/
# redirect to 404.php
RewriteRule ^ 404.php [R=302,L]
或者,如果不想在浏览器中进行外部重定向:

#turn on mod_rewrite
RewriteEngine On
#see if the url is ...
RewriteCond %{REQUEST_URI} ^\/\.well-known\/acme-challenge\/
# send 404
RewriteRule ^ - [R=404,L]
# change to 403 if don't want 404

为什么您认为您需要阻止访问?abc只是一个样本。我放在那里的任何字符串都会在输出中回响。如果我放置/.well-known/acme challenge/xyz,它还将打印ssl证书,后跟“xyz”。我还尝试添加了重定向匹配403\。well-known\/acme challenge\/无效,为什么要隐藏此证书?