需要拒绝除了我的所有IP访问网站并显示友好的错误

时间:2022-11-11 22:25:21

I need to deny all IPs except mine.

我需要拒绝除了我的所有IP。

I got my outward facing IP from whatismyip.com. Let's assume it is 200.200.200.200

我从whatismyip.com获得了我的外向IP。我们假设它是200.200.200.200

Here is the beginning of my .htaccess

这是我的.htaccess的开头

ErrorDocument 403 /down.html

<Limit GET POST>
order deny,allow
deny from all
allow from 200.200.200.200
</Limit>

This works with the denying part - it shows my down.html page. However it denies me even when I place my correct IP in the .htaccess. Am I doing something wrong?

这适用于拒绝部分 - 它显示我的down.html页面。然而,即使我将正确的IP放在.htaccess中,它也会否认我。难道我做错了什么?

Also the down.html page contains an image - but seeing as all requests are being denied, I had to host it on a different domain to get it to display. My .htaccess skills are a little rusty, but how would I go about allowing that one image request through using .htaccess on this domain?

此外,down.html页面包含一个图像 - 但是当所有请求被拒绝时,我必须将其托管在不同的域上才能显示它。我的.htaccess技能有点生疏,但是如何通过在这个域上使用.htaccess来允许一个图像请求呢?

1 个解决方案

#1


9  

<Limit GET POST>
order allow,deny
allow from 200.200.200.200
deny from all
</Limit>

#1


9  

<Limit GET POST>
order allow,deny
allow from 200.200.200.200
deny from all
</Limit>