Products
96SEO 2025-05-14 04:44 3
RewriteEngine On
开启沉写功能, 并通过RewriteCond
设置允许引用的站点列表,如:
RewriteCond %{HTTP_REFERER} !^http://?yourdomain\.com
该规则将阻止全部非指定域名的引用站点求。
.htaccess
文件中添加防盗链规则,如:
RewriteRule \.$ -
此规则阻止指定文件类型的访问。
/usr/local/apache/conf/httpd.conf
或Apache 2.2的/usr/local/apache2/conf/extra/httpd-vhost.conf
。
sudo systemctl reload apache2
确保从不同站点访问受护着的材料,验证防盗链规则是不是生效。
RewriteCond %{HTTP_REFERER} !^http://?subdomain\.yourdomain\.com
Demand feedback