After SEO

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ahmet
Forum Newbie
Posts: 1
Joined: Sat Feb 06, 2010 11:57 am

After SEO

Post by Ahmet »

I'm writing here because There is no title about http or seo in forum.
I'm have a website in use. Bots cached already but i'm changed url like this:

index.php?go=Products&prodno=43

with that:

product-that-you-are-interested.html

I added canonnical meta tag and this script for cached links...

Code: Select all

 
if (preg_match('/\/index\.php\?go\=Products\&prodno\=([0-9]*)/', $_SERVER['REQUEST_URI'], $number)) {
    $query = db("SELECT canonnical_name FROM products WHERE prod_no='".$number[1]."'");
    if (@ $answer = fetchit($query)) {
        header("HTTP/1.0 301 Moved Permanently");
        header('location: /'.$answer[0].'.html');
    } else {
        header('location: /');
    }
    exit();
}
 
Is that enough?
Post Reply