问题原文
原帖链接 · Maximillian Laumeister · CC BY-SA 4.0
I have a domain name, https://seo.example.com/, that is currently showing up in Google Search results. I want to set up a redirect such that when visitors view that domain, they are immediately redirected to a different domain, https://www.example.com/seo/. The complicating part is that I also want to keep the original domain in the Google search results instead of having Google display the redirect target.
My first thought was to use a 302 redirect from https://seo.example.com/ to https://www.example.com/seo/, and set a canonical meta tag on the target page with the content https://seo.example.com/. Would this accomplish my goal of keeping the original domain in Google search while also redirecting away from it, or would Google consider this an improper use of the canonical tag and tank the search ranking of one or both pages?
Is there a way to do this above water or is it impossible by design?
已采纳解答
原帖链接 · MrWhite · CC BY-SA 4.0
Google is unlikely to return the source of a redirect in organic search results, even a 302 (temporary) redirect, for very long. Particularly when the target URL is a different hostname.
Would this [canonical meta tag] accomplish my goal of keeping the original domain in Google search while also redirecting away from it, or would Google consider this an improper use of the canonical tag and tank the search ranking of one or both pages?
The meta tag will likely be ignored. It does not make sense for Google to penalise such "improper use". The canonical meta tag is simply a suggestion. An external redirect is a much stronger suggestion.
However, unless you are restricted by your host in some way, you should never need to do this kind of redirect - so I'm curious as to the backstory here?
Can you not change the subdomain / server config so that it points to the correct location directly?
If you are wanting to maintain the URL and serve the content from a different host then you should consider implementing a reverse proxy instead.
If
www.example.com/seo/is actually on the same server (same filesystem) - as implied by the sameexample.comdomain - then you may only need an internal rewrite.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
