How this site about Globalwarming Awareness2007 do redirects SEO friendly using PHP
Every SEO knows that when a page's URL is changed we have to say to the client (also a spider is a client) what is the new URL.
The HTTP/1.1 protocol provides those headers to do this:
HTTP/1.1 301 Moved Permanently
Location: http://globalwarming-awareness2007.bloster.altervista.org/new-location.html
The 301 status code means that the page requested is Moved Permanently.
Location indicate the new page location.
Using PHP we can send an HTTP header using the header function.
Well, when I change an URL I update my option redirect in my MySQL table in this way:
<?php
// If option redirects exists then get it
$redirect = get_option('redirects');
// Add 1 item in the array $redirect.
// array index = old URL; value = new URL
$redirect[$_POST['old-url']] = $_POST['new-url'];
// Save the option
update_option('redirects', $redirect);
...
Therefore I save an array with a structure that look like this:
Array
(
[globalwarming-awareness2007/globalwarming-awareness2007-directories-list.html] => globalwarming-awareness2007/directories-list.html
...
)
And when a page are requested:
<?php
$redirect = get_option('redirects');
if($redirect[$page_requested]){
header("HTTP/1.1 301 Moved Permanently");
header("Location: /index.php/".$redirect[$pag[1]]);
header("Connection: close");
exit();
}
That's all folks! :-)
Technorati tags: SEO PHP Globalwarming Awareness2007 HTTP redirect 301
My Awareness2007 - Index:
- Manage options using PHP and MySQL
- How this site about Globalwarming Awareness2007 do redirects SEO friendly using PHP
SEO Contest
GlobalWarming Awareness2007:
- Bed and Breakfast Rome. Complete Italian B&B Directory. Bed & Breakfast Italia.

- GlobalWarming Awareness2007.
- GlobalWarming Awareness2007.
- GlobalWarming Awareness2007.
- GlobalWarming Awareness2007.
- GlobalWarming Awareness2007.
- GlobalWarming Awareness2007.
- GlobalWarming Awareness2007.
- Your link here!.
