php redirect and SEO

by 4 replies
5
Hi,

for SEO pourposes, i want to name my main site "keyword.html" rather than "index.html".

I read this could be done with a php-redirect like this one:


Code:
<?php 
header("HTTP/1.1 301 Moved Permanently"); 
header("Location: hxxp://mydomain.com/keyword.html"); 
header("Connection: close"); 
?>
Regarding to what i have read, i just put an index.php filled with the code above in my Document Root.

Is this the best method? Sure that google will not punish me in any way?

Thanks for your help.
#programming #php #redirect #seo
  • you don't always need a redirect. If your page is indexed and you have been building links then you need a redirect otherwise forget it.

    and you don't need a php redirect for this case since you are renaming your old html to new html file do this instead with a .htaccess file

    but this will move your index page to a web page called keyword.html.
    and why you want to do that? As the index page always has the most weight out of it?
    • [1] reply
    • So for SEO, its not useful to do this? Sounds logically that the index page always has the most weight - seems i read a bit to much

      Thank you for clearing this up for me.
  • As long as you are using 301 redirects you should be fine SEO wise.

    it is 302 redirects that start getting tricky and can get you into trouble.
    • [1] reply
    • Use htaccess with 301 redirect.

Next Topics on Trending Feed