Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

apache - htaccess: I cannot allow access from a specific domain instead of IP

I want to allow the connection from my LAN and in the case, that the external ip matches my ip (for when I use my domain to connect internal to my http server via browser)

I found this:

Require forward-dns bla.example.org

but I get an 403 Forbidden :/

My .htaccess looks like this:

Order Deny,Allow
Deny from all
Allow from 192.168.254.1/24
Require forward-dns mydomain.de

Thank you :C


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)

Here is the answer I have worked out: I use a scipt to enter the IP address in the hosts file.

Follow the instructions from: https://www.the-art-of-web.com/system/apache-auth-ddns/

After that it works with the following command in .htaccess

Allow from yourDomain.de

Its not the best answer, but it will work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...