| 主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情! |
| 我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作 |
查看user_agent
打开日志文件 cat /usr/local/apache2/logs/test.com-access_20161111_log
如何不显示chrome和curl的日志
1.打开虚拟主机配置文件
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作为标记)
条件一Rewritecond %{HTTP_USER_AGENT} ^.*curl.* [NC,OR] 添加的代码,关于curl
条件二Rewritecond %{HTTP_USER_AGENT} ^.*chrome* [NC] 添加的代码,关于chrome
结果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
--------------------------------------------------------------
主机参考,收集国内外VPS,VPS测评,主机测评,云服务器,虚拟主机,独立服务器,国内外服务器,高性价比建站主机相关优惠信息@zhujicankao.com
详细介绍和测评国外VPS主机,云服务器,国外服务器,国外主机的相关优惠信息,商家背景,网络带宽等等,也是目前国内最好的主机云服务器VPS参考测评资讯优惠信息分享平台
这几篇文章你可能也喜欢:
- 0🔥 -hengchuang Technology 618折扣:整个服务器上有25%的折扣,您将获得高的防御IP,并且对老年用户的更新将从开始。
- Raksmart:新年特别优惠,美国服务器的每月付款起价为30美元,云主机起价为14.99美元/年
- ACEBGP:美国双ISP壳体IP VPS高速AS9929网络解锁流和国际应用
- SpinServers,美国高性能高配置大带宽独立服务器特价优惠低至$109/月,美国圣何塞/达拉斯,10Gbps超大带宽
- Corocross:新添加的多伦多计算机房,每月付款起价为每月1.66美元,每月付款起价10美元
本文由主机参考刊发,转载请注明:如果根据日志去禁用user_agent https://zhujicankao.com/12612.html
主机参考















评论前必须登录!
注册