Apache 瀏覽器訪問限制配置

2022-06-11 19:12:12 字數 899 閱讀 1155

瀏覽器訪問限制配置

限制配置

方式一

# 開啟功能模組

rewriteengine on

# 指定引擎*firefox/4.0

rewritecond % ^.*firefox/4.0*[nc,or]

# 指定引擎tomato bot/1.0

rewritecond % ^.*tomato bot/1.0*[nc]

# 防止死迴圈、不匹配404跳轉到這裡

rewritecond % !^/404*# 如果指定到搜尋引擎就報404錯誤

rewriterule .* /404

.html

配置檔案

注:請注意,你的404.html千萬別在傳到其他頁面了,否則很可能就會死迴圈。

注:其實rewrite到404.html並不是很好的辦法,而apache的rewrite功能有意向就是forbidden,那就是f。

方式二

# 開啟功能模組

rewriteengine on

# 指定引擎*firefox/4.0

rewritecond % ^.*firefox/4.0*[nc,or]

# 指定引擎tomato bot/1.0

rewritecond % ^.*tomato bot/1.0*[nc]

# 如果指定到搜尋引擎就顯示forbidden

rewriterule .* -[f]

配置檔案

瀏覽器 cookie 限制

一 瀏覽器允許每個網域名稱所包含的 cookie 數 microsoft 指出 internet explorer 8 增加 cookie 限制為每個網域名稱 50 個,但 ie7 似乎也允許每個網域名稱 50 個 cookie update to internet explorer s cooki...

瀏覽器不能訪問本地資源的限制

做乙個截圖上傳的功能,想在上傳前在網頁中顯示預覽,發現做不到。原因 html,js不能直接訪問本地資源,否則存在嚴重的安全隱患。類似的還有,js不能設定input file中的值 今天了解到,這個叫做 客戶端程式語言 的同源策略 同源策略規定跨域之間的指令碼是隔離的,乙個域的指令碼不能訪問和操作另外...

apache 限制IP訪問

options all allowoverride none order deny,allow deny from all allow from 192.168.0.0 24 allow from 127.0.0.1 allow from 59.37.x.x 28 上面這一段的意思是對 var ww...