问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
