tags:

views:

12

answers:

1

hi,

I've to correct the google search title and summary for a website having the following code as home page:

<?php
   header("Location:/mil/index.php");
?>

It forwards the user to another page. I know this is not good, but I was wondering how to quickly fix it.

If I add etc... to this page, is enough ? Is google grabbing the information from this page ?

Or is it grabbing from the website pages and bypassing this page ?

thanks

+1  A: 

At the moment you are performing a 302 redirect, which tells Google that content found at the first page has temporarily moved to the second. Because of this, Google will not update it's index, and will continue to treat the first page as the important one. If it's empty, then that is no good for your search rankings. Do this instead:

header ('HTTP/1.1 301 Moved Permanently');
header ("Location:/mil/index.php");

A 301 redirect tells Google that the content has permanently moved to the new location, and they will update their index appropriately.

If this is a permanant redirect, and you have access to the .htaccess file, then a faster, cleaner way of doing this would be to let Apache handle it. If your first script contains nothing but that redirect, then delete it completely and add this line to your .htaccess file:

Redirect 301 /the-first-script.php /mil/index.php
MatW
So, by adding before "header ('HTTP/1.1 301 Moved Permanently'); " I solve my problem, because Google is going to grab the meta information from the destination page (Joomla website). Am I right ? I'm asking you, because it takes 2 weeks for google to update results of a small website.
Patrick
It should begin indexing the content on the destination page, yes. Also, the size of the website doesn't really affect how often Google indexes it; how often the content on the website changes will have a much bigger effect.
MatW