大网数据广告活动
网站运营与故障问答

Random Keyword String added to URL in google results

· 52CE 我爱测

Ok, so this is a new one on me. In certain google results for one of my sites, I am getting this for example: http://example.com/directory/sort-diamante-grand-canyon-spa-error-codes/index.php instead of: http://example.com/direct…

问题原文

原帖链接 · corvidmemory · CC BY-SA 3.0

Ok, so this is a new one on me. In certain google results for one of my sites, I am getting this for example:

http://example.com/directory/sort-diamante-grand-canyon-spa-error-codes/index.php

instead of:

http://example.com/directory/index.php

Checking Google Analytics, there are some other landing hits for similar structured "ghost" directory strings such as "griddle-hindi-hot-masala-movies-torrent".

Sitemap is clean... Obviously the directories do not exist on the server... Any ideas?

已采纳解答

原帖链接 · pro_ng · CC BY-SA 3.0

Someone is trying to manipulate your URLs and getting away with them because of a flaw in your original PHP script.

Your script is allowing anything entered between /directory/ and /index.php to be rewritten (through your mod_rewrite rules) and 'allowing' it to actually return a valid page instead of a 404. So if I am your competitor or just a malicious individual, there is nothing stopping me from creating random urls like /corvid-memory-is-a-fraud/index.phpcreating not only a bad reputation for your website but also invoking a massive issue of content duplication.

You need to revise your mod_rewrite rules in a way that when a request for any URL is generated, it should pass the part preceding /index.php to the script and the script should validate it by matching it with the database entry for the page name. It no matches are found, it should return an HTTP 404 error.

Talk to your developers/ server admins about it and they should be able to come up with the right solution to address this situation.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。