| 主機(jī)參考:VPS測評參考推薦/專注分享VPS服務(wù)器優(yōu)惠信息!若您是商家可以在本站進(jìn)行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務(wù),查看詳情! |
| 我們發(fā)布的部分優(yōu)惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關(guān)文章充分了解該商家!若非中文頁面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作 |
查看user_agent
打開日志文件 cat /usr/local/apache2/logs/test.com-access_20161111_log
如何不顯示chrome和curl的日志
1.打開虛擬主機(jī)配置文件
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
添加一代代碼
<IfModule mod_rewrite.cgt;
? ? ? ? RewriteEngine on
? ? ? ? RewriteCond %{HTTP_HOST} ^www.test.com$ [OR]
? ? ? ??RewriteCond %{HTTP_HOST} ^www.aaa.com$ ----添加一行
? ? ? ? RewriteRule ^/(.*)$ http://ww.lizheng.com/$1 [R=301,L](以/開始,$1作為標(biāo)記)
條件一Rewritecond %{HTTP_USER_AGENT} ^.*curl.* [NC,OR] ? ?添加的代碼,關(guān)于curl
條件二Rewritecond %{HTTP_USER_AGENT} ^.*chrome* [NC] ?添加的代碼,關(guān)于chrome
? 結(jié)果RewriteRule ? ? .* ?- ?[F] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?禁止
</IfModulegt;
2.重新啟動,加載
apachectl -t
apachectl graceful
3.測試
curl -x127.0.0.1:80 www.lizheng.com/asasddas
View user agent
Open the log file cat / usr / local / apache2 / logs / test.com-access ABCD log
How not to display chrome and curl logs
1. Open the virtual host configuration file
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
Add a generation of code
<IfModule mod_rewrite.cgt;
? ? ? ? RewriteEngine on
? ? ? ? RewriteCond %{HTTP_HOST} ^www.test.com$ [OR]
Rewritecond% {http_host} ^ www.aaa.com $--- add a line
RewriteRule ^ / (. *) $http://ww.lizheng.com/ $1 [R = 301, l] (start with / and mark with $1)
Code added by condition 1 rewritecond% {http ﹣ user ﹣ agent} ^. * curl. * [NC, or], about curl
Condition 2 rewritecond% {http ﹣ user ﹣ agent} ^. * chrome * [NC] added code, about Chrome
Result RewriteRule. * - [F] forbidden
</IfModulegt;
2. Restart, load
Apachectl -t
apachectl graceful
3. test
curl -x127.0.0.1:80 www.lizheng.com/asasddas
--------------------------------------------------------------
主機(jī)參考,收集國內(nèi)外VPS,VPS測評,主機(jī)測評,云服務(wù)器,虛擬主機(jī),獨立服務(wù)器,國內(nèi)外服務(wù)器,高性價比建站主機(jī)相關(guān)優(yōu)惠信息@www.k2270.com
詳細(xì)介紹和測評國外VPS主機(jī),云服務(wù)器,國外服務(wù)器,國外主機(jī)的相關(guān)優(yōu)惠信息,商家背景,網(wǎng)絡(luò)帶寬等等,也是目前國內(nèi)最好的主機(jī)云服務(wù)器VPS參考測評資訊優(yōu)惠信息分享平臺
這幾篇文章你可能也喜歡:
- 華納云:服務(wù)器2.3折起,香港CN2服務(wù)器低至800元/月,海外云服務(wù)器月付7折,季付5.5折,續(xù)費同價。
- Band wagon主機(jī):92.30美元/年/2核/2G內(nèi)存/40SSD/1T流量/1Gbps/ CMI/香港/軟銀大阪/CN2 GIA洛杉磯。
- Spinservers:美國達(dá)拉斯機(jī)房獨立服務(wù)器年中推廣!(達(dá)拉斯機(jī)場是美國的哪個城市?)
- 萊卡棉:七月促銷!港美歐云服務(wù)器產(chǎn)品低至15.9元(徠卡論壇)
- 華納云:100M專屬大帶寬服務(wù)器低至688元/月,不限流量/現(xiàn)場交付,適用于CDN/視頻直播多場景應(yīng)用。
本文由主機(jī)參考刊發(fā),轉(zhuǎn)載請注明:如果根據(jù)日志去禁用user_agent http://www.k2270.com/12612.html
主機(jī)參考
















評論前必須登錄!
注冊