簡體   English   中英

.htaccess文件中的“ /”斜杠是什么意思,例如指令“ allow from 000.111.222.333/444”?

[英]What is the meaning of the “/” slash in such as the directive “allow from 000.111.222.333/444” in a .htaccess file?

例如,我的.htaccess文件中包含以下指令:

<Limit GET HEAD POST>
order deny,allow
allow from 1.37.0.0/16
allow from 23.226.128.240/31
allow from 23.234.68.64/27
allow from 23.234.80.200/29
allow from 23.234.91.160/27
deny from all
</Limit>
  • 其中的“ /”斜杠是什么意思?
  • 以及如何將它們轉換為mod_rewrite指令?

該值定義掩蓋地址中最高有效位的位數。 有關更多詳細信息,請參見CIDR上Wikipedia頁面

例如,如果我指定10.0.0.0/8 ,則表示允許10.* (或拒絕,無論何種情況)。 這是因為IPv4地址中的每個八位位組都有8位(1個字節,又稱八位位組)。 如果我指定192.168.0.0/24 ,則掩蓋了前24位(前3個八位位組),並且允許或拒絕192.168.0.*

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM