简体   繁体   中英

redirect page but keep meta tags

Im redirecting a page using

header('Location: http://www.example.com/');

Google indexed my page but is using the meta tag of the page im redirecting to. Is there a way to keep my meta tags for google but still redirect to the site? Maybe with a countdown before redirect?

greets

You could use this instead.

<meta http-equiv="refresh" content="0; url=http://example.com/" />

The 0 after content can be replaced with a number of seconds before the page is redirected. Here's some more information.

Alternatively, you could use robots.txt, or redirect using javascript. For robots.txt, follow this guide. http://www.robotstxt.org/robotstxt.html

Let me know if this helped you out!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM