: 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
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?
More posts by @Mendez628
1 Comments
Sorted by latest first Latest Oldest Best
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 );
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.