: Is it possible to get search engines to index redirects I have a use case where users should be redirected but bots and open graph should not be. While I could redirect based on user agent,
I have a use case where users should be redirected but bots and open graph should not be. While I could redirect based on user agent, I was wondering if there were a simpler way, perhaps a protocol which a bot would ignore but a browser would not.
I seem to have a vague recollection of reading of the case where Google indexed a page which included a header with a redirect directive because the page still had content, but I don't know if that would still work or if I am remembering incorrectly.
For clarification, this is roughly the pattern I was contemplating:
Location: /
<html>
<head>
<meta property="og:type" content="website" />
<meta name="twitter:title" property="og:title" itemprop="title name" content="My favorite title" />
<meta name="twitter:description" property="og:description" itemprop="description" content="huzzah for descriptions" />
<meta property="og:url" content="http://example.com"/>
<title>Ducts through the centuries</title>
</head>
<body>
This is the body
</body>
</html>
Is there a way to have Google index the above body while including the redirect header? Will Facebook pickup the open graph tags? What about twitter?
More posts by @Samaraweera270
1 Comments
Sorted by latest first Latest Oldest Best
What you're doing is not a good idea as it creates cloaking which violates google's webmaster guidelines. On top of that, many modern web browsers will ignore the textual HTML if they come across a Location: header with the proper redirect status code.
The textual HTML in the normal redirect-based pages are there for compatibility reasons. This means if you had a super old web browser that doesn't understand the Location: header, then people will see a redirect message on the screen similar to:
Moved
The document has been moved here
...where the word "here" is a link to the new URL of the document.
The only way you could pull your idea off which is something I 100% advise against is to create an endless redirect loop (meaning make the value of location as the current URL). Then if you have apache, the server will quit the redirection after so many times and then output the redirection page. This is bad for the user and search engines.
If you want pages indexed, only index pages people want to see.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.