Javascript redirect vs PHP redirect, which search engines view as regular content

I assume that using a PHP header ("location: here.html") will be much better than javascript window.location ("here.html") as far as search engine visibility. I would suggest that server redirection will show google the correct content, and javascript redirection will be read as a page with javascript redirect code.

The reason is because I have a client who wants me to run their current site and import it into the CMS (I use e107), and I do not want their old pages to lose their current page rank. I was thinking about moving redirects to old pages to new pages in the CMS system.

+4
source share
2 answers

The only way to redirect to search engine rank is to redirect HTTP 301 (persistent).

Using PHP header('Location') will give 302 if you do not specify this code:

 header('Location: http://....', true, 301); 

It may be easier to use .htaccess, for example:

 RewriteRule ^old.php /new.php [R=301] 
+7
source

Yes, you want to do server-side redirection (PHP) if you can.

 <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?> 

across

You can also do this using

 header("location: http://www.new-url.com") 

but it will not be as good as wise SEO

+6
source

All Articles