【发布时间】:2020-12-21 07:33:12
【问题描述】:
我的一个网站遭到黑客入侵。在我清理它之后,谷歌中有很多虚假的垃圾邮件 URL。现在我正在尝试将它们设置为 410 Gone 并从 Google Search Console 中删除它们。
我尝试在.htaccess 中添加但没有显示410 而是显示404。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^https://example.com/156224863/scojgmwtdxy-7/cv.def - [L,NC,G]
</IfModule>
如果我添加这个
RewriteRule !^index\.html$ https://example.com/156224863/scojgmwtdxy-7/cv.def [L,R=410]
它正在重定向所有内容。甚至根域https://example.com/ 我也不想。
我在这里想念什么?
【问题讨论】:
标签: apache .htaccess redirect mod-rewrite url-rewriting