问题原文
原帖链接 · Jaime Montoya · CC BY-SA 4.0
I am experiencing the issue explained at https://stackoverflow.com/questions/53065450/subdomains-that-dont-exist-are-indexed-by-google-zombie-subdomain-removal-via. Notice how the the search engine Google returns a result linking to my site (see the image below):
I never configured ww.w as a subdomain in my Apache configuration. I have no idea where Google took that from. I did configure https://www.jaimemontoya.com to simply redirect to https://jaimemontoya.com, which means simply removing the www. I did that by creating a CNAME Record to specify that www.jaimemontoya.com is an alias of jaimemontoya.com. But I never configured anything for ww.w as a CNAME Records, nor in the Apache configurations. I wonder where Google took that configuration from.
What I understand from https://stackoverflow.com/questions/53065450/subdomains-that-dont-exist-are-indexed-by-google-zombie-subdomain-removal-via, in the answer by @MrWhite, was that the solution is: "Remove the wildcard subdomain and it will resolve your issue." How are wildcard subdomains removed? Is that done from the Apache configuration, or by creating DNS Records maybe for * to apply to all subdomains? I am guessing I might need to write something in a <VirtualHost *:443> block in the Apache configuration, to remove wildcards for subdomains. Thank you.
UPDATE 1: I am running the website on a DigitalOcean Virtual Private Server. This is not a shared hosting service and I have created the Apache configurations myself from scratch. So I am not using any of the pre-built standard configurations that shared hosting services typically provide.
UPDATE 2: Find updates to this question at https://stackoverflow.com/questions/77558953/how-to-remove-the-wildcard-subdomain-on-apache-to-prevent-google-from-indexing-s.
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 4.0
Wildcard subdomains are specified in DNS. To remove the wildcard subdomain you need to remove the * record from your DNS records.
You could also configure Apache to respond with 404 errors for unrecognized host names. To do this, create two VirtualHost directives. Whichever one comes first is the default one that is used for unknown host names. Virtualhost config: routing and wildcard usage has example configuration for this.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
