从 Google 上的网址中删除 PHP 脚本
我在 .htaccess
上犯了一个错误(我不知道怎么回事),我的文章在 Google 上的部分链接已从:更改
mysite/articles/isfahan_articlesXXX.html
为:
mysite/maghalat.php/isfahan_articlesXXX.html?id=XXX
其中 XXX 是文章 ID 。 我当前包含文章的 .htaccess
部分是:
RewriteRule ^articles/isfahan_articles([0-9]+).html$ maghalat.php?id=$1
Redirect 301 ^maghalat.php/isfahan_articles([0-9]+).html?id=([0-9]+)$ mysite/articles/isfahan_articles$1.html
但是它仍然不会重定向:
mysite/mghalat.php/isfahan_articlesXXX.html?id=XXX
至:
mysite/articles/isfahan_articlesXXX.html
我还想从 Google 中删除此链接:
mysite/articles/isfahan_articlesXXX.html
I made a mistake (I don't know how) on my .htaccess
and a part of my artilcle's links on Google have changed from:
mysite/articles/isfahan_articlesXXX.html
To:
mysite/maghalat.php/isfahan_articlesXXX.html?id=XXX
Where XXX is article's ID.
My current .htaccess
part that contains articles is:
RewriteRule ^articles/isfahan_articles([0-9]+).html$ maghalat.php?id=$1
Redirect 301 ^maghalat.php/isfahan_articles([0-9]+).html?id=([0-9]+)$ mysite/articles/isfahan_articles$1.html
However it still will not redirect:
mysite/mghalat.php/isfahan_articlesXXX.html?id=XXX
To:
mysite/articles/isfahan_articlesXXX.html
I would also like to remove this link from Google:
mysite/articles/isfahan_articlesXXX.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该检查您的链接,似乎该页面是由于某处错误而创建的。但我只是猜测。
您还可以在 robots.txt 中添加一个模式,禁止机器人抓取您的页面。
问候,
You should check your links, its seems that this pages are created because of an error somewhere. But I'm just guessing.
You also can add a pattern in your robots.txt that disallow robot to crawl your pages.
Regards,
当您使用 301(永久移动)状态代码进行重定向时,它最终将从 Google 中消失。
When you redirect using a 301 (moved permanently) status code, it will disappear from Google eventually.
要从 Google 索引中删除网页,您需要创建一个 Google 帐户并使用 Google 网站站长工具。添加您的网站并按照说明验证您是该网站的所有者。有一个选项可以删除网址。
您要删除的网页必须满足一些条件< /a>:需要限制访问或返回 404 或 410 错误代码。
当您的文章的旧网址被阻止或删除时,新网址再次出现在谷歌索引中只是时间问题。
To remove pages from Google's index you need to create a google account and use Google Webmaster Tools. Add your website and Follow the instruction to validate that you are the owner of the site. There is an option to remove urls.
The pages you want to remove must meet some criteria: They need be access restricted or return a 404 or 410 error code.
When the old urls are of your articles are blocked or removed, it's just a matter of time until the new ones will appear again in the google index.