共计 1431 个字符,预计需要花费 4 分钟才能阅读完成。
[裴先生笔记]htaccess备份
php_value upload_max_filesize 15M
php_value post_max_size 15M
# BEGIN WordPress
# 在“BEGIN WordPress”与“END WordPress”之间的指令(行)是
# 动态生成的,只应被WordPress过滤器修改。
# 任何对标记之间的指令的修改都会被覆盖。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<IfModule mod_rewrite.c>
# 开启重写引擎
RewriteEngine On
# 检查是否是 crushnear.com 或 www.crushnear.com
RewriteCond %{HTTP_HOST} ^(www\.)?crushnear\.com$ [NC]
# 如果是,则重定向到 https://blog.peiluming.com,并保留原始的请求路径和查询字符串
RewriteRule ^(.*)$ https://blog.peiluming.com [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
# 开启重写引擎
RewriteEngine On
# 检查是否是 HTTP 协议
RewriteCond %{HTTPS} off
# 如果是,则重定向到 HTTPS 协议,并保留原始的请求路径和查询字符串
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# 屏蔽无效爬虫
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^.*DataForSeoBot.* [NC]
RewriteRule .* – [F]
RewriteCond %{HTTP_USER_AGENT} ^.*MJ12bot.* [NC]
RewriteRule .* – [F]
RewriteCond %{HTTP_USER_AGENT} ^.*AhrefsBot.* [NC]
RewriteRule .* – [F]
RewriteCond %{HTTP_USER_AGENT} ^.*SemrushBot.* [NC]
RewriteRule .* – [F]
RewriteCond %{HTTP_USER_AGENT} ^.*netEstate\ NE\ Crawler.* [NC]
RewriteRule .* – [F]
RewriteCond %{HTTP_USER_AGENT} ^.*DotBot.* [NC]
RewriteRule .* – [F]
RewriteCond %{HTTP_USER_AGENT} ^.*BLEXBot.* [NC]
RewriteRule .* – [F]
RewriteCond %{HTTP_USER_AGENT} ^.*CCBot.* [NC]
RewriteRule .* – [F]
</IfModule>