3

Will the Google ranking of my page increase when I use a meta refresh with a timer of 2 seconds instead of a 302 redirect without a timer?

I'm using this code:

<meta http-equiv="refresh" content="2; url=http://example.com/" />
4
  • Neither meta-refresh nor 302 redirects are best for SEO. Can you use a 301 redirect instead? – Stephen Ostermiller Dec 6 '17 at 18:41
  • yes i can, but i want the page that has the 302 redirect to keep its meta tags and get listed on google – Jonas Amsamoto Dec 6 '17 at 19:01
  • 302 redirects don't keep meta tags. You keep misusing that term when you should instead be saying "meta-refresh". – Stephen Ostermiller Dec 6 '17 at 19:02
  • Google understands the meta-refresh tag and suggests that you don't use it. support.google.com/webmasters/answer/79812?hl=en I suspect that Google won't index pages that have a meta refresh to a different URL in a low number of seconds. – Stephen Ostermiller Dec 6 '17 at 19:04
1

I wish I could use your idea of meta refresh as well, but in today's society, you want to cause your server to fabricate the following HTTP header for a redirect (where URL after Location is the new URL):

HTTP/1.1 301 Moved Permanently
Location: http://example.com

This can be done in PHP by the following code:

<?php 
header("HTTP/1.1 301 Moved Permanently",true);
header("Location: http://example.com",true);
?>

The advantage here is speed because the header is picked up right away where as the meta tag is picked up several bytes later in the code plus there is no delay with this method.

If you want to continue to help guests who use browsers that don't support automatic refresh, then you can use a PHP script like the following:

<?php 
header("HTTP/1.1 301 Moved Permanently",true);
header("Location: http://example.com",true);
?>
<html>
<head>
<title>Moved</title>
</head>
<body>
<h1>Moved</h1>
<a href="http://example.com">Access Document here</a>
</body>
</html>

That way, guests of old browsers will instead see a link that they can click on to access the new document.

To help with your ranking, modify your sitemap files so that the URLs point to actual content pages, instead of pages that redirect to content so that search engines don't do unnecessary crawling.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.