Mobile app version of vmapp.org
Login or Join
Mendez628

: Can I use meta refresh instead of 301 redirect? I have submitted my site with ugly URLs to Google, and now they are appearing as mysite.com/show.php?id=42. Now, I know that I can 301-redirect

@Mendez628

Posted in: #301Redirect #Google #Googlebot #MetaTags #Redirects

I have submitted my site with ugly URLs to Google, and now they are appearing as mysite.com/show.php?id=42.

Now, I know that I can 301-redirect it to mysite.com/article/42. However, my site uses the URL form like stack exchange, so like this mysite.com/article/42/title-of-my-article which is in fact index.php?what=content&id=42&title=title-of-my-article.

Therefore, I cannot use only .htaccess for this, right?

So will it work if I do this?


Keep show.php as the redirect node
if user comes to show.php?id=42 , get the article of title with id=42, and echo "<meta http-equiv='refresh' content='0; url=http://mysite.com/article/42/$title'>


It will work for the visitors, but will it help Google to understand and change the URL to the new one?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Mendez628

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

In your show.php it looks like you have the title you need for the URL. So instead of echoing the meta tag, use PHP to do a 301 redirect:

header("HTTP/1.1 301 Moved Permanently");
header("Location: mysite.com/article/42/$title );

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme