怎样配置.htaccess,403设定为什么只有首页有效?

WBOY
Release: 2016-06-23 13:51:28
Original
710 people have browsed it

我想屏蔽掉这只蜘蛛,用了以下规则,发现只有首页有效,内页依然在爬,是不是写法上不全面?怎样修改?
RewriteCond %{HTTP_USER_AGENT} ^MJ12bot$
RewriteRule ^.* - [F,L]

之前因为换了这个新域名www.tvtv.hk,对旧域名做过301跳转,修改.htaccess也遇到一样的问题,首页能成功执行,内页不行


回复讨论(解决方案)

单看这句没有问题,要看看在这之前是否有其他rewrite影响。

单看这句没有问题,要看看在这之前是否有其他rewrite影响。


多谢,之前做了伪静态,把代码放在第一行就解决了
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn