SEO and Google

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
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

SEO and Google

Post by blacksnday »

I have used htaccess to convert my urls to be SEO, but it seems that Google doesnt like them.
MSN has indexed the new form, so I am trying to figure out why Google won't take it also.

The stuff in the .htaccess is

Code: Select all

RewriteEngine on
Options +FollowSymlinks
RewriteRule display/news/([0-9]+) /display.php?news=$1

ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
and the code to create my prev/next links is

Code: Select all

$news = $row['id'];
$max_results = 1; 

if(!isset($_GET['news'])){ 
$news = 1;
} else { 
$news = $_GET['news']; 
}

//SQL CODE STUFF HERE
$from = (($news * $max_results) - $max_results); 
$sql = mysql_query("SELECT * FROM table LIMIT $from, $max_results"); 
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM table"),0); 
$total_news = ceil($total_results / $max_results); 
//THEN the below makes the next/prev links

if($news > 1){ 
$prev = ($news - 1); 
echo "<center><a href=\"http://siteurl.com/display/news/$prev\"><<-Previous</a>     "; 
}

if($news < $total_news){ 
$next = ($news+ 1); 
echo "     <a href=\"http://siteurl.com/display/news/$next\">Next->></a><br />"; 
}
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

and why don't you think google has taken it?

google can take quite some time to crawl your site...give it a while.
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

Google has been indexing my site for the past 5 months.
Google DOES have the new pages, but only the index page of the site.
It refuses to index all other pages that use the SEO.

Besides, the main point of my post was to ask about the way I am doing SEO.
was just using google as an example.
Didnt mean to confuse anyone.

I know that there are many ways that SEO can get you blacklisted from Search engines
and I was just wanting to make sure the above way i am doing it is proper enough to
be safe.
User avatar
Nathaniel
Forum Contributor
Posts: 396
Joined: Wed Aug 31, 2005 5:58 pm
Location: Arkansas, USA

Post by Nathaniel »

Are you overwriting the 404 header? Google won't index a 404 page, ya know... ;)
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

Nathaniel wrote:Are you overwriting the 404 header? Google won't index a 404 page, ya know... ;)
Just what I put in the htaccess to direct to index page.
I use same ErrorDoc handler on my other site which is a blog site and
havent had any problems with Search Engines not indexing.
User avatar
Nathaniel
Forum Contributor
Posts: 396
Joined: Wed Aug 31, 2005 5:58 pm
Location: Arkansas, USA

Post by Nathaniel »

blacksnday wrote:
Nathaniel wrote:Are you overwriting the 404 header? Google won't index a 404 page, ya know... ;)
Just what I put in the htaccess to direct to index page.
I use same ErrorDoc handler on my other site which is a blog site and
havent had any problems with Search Engines not indexing.
Apache is sending out a 404 header when Apache directs the request to the index page. I would highly recommend putting

Code: Select all

<?PHP header("HTTP/1.1 200 OK"); ?>
in index.php, before the headers are sent.
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

Nathaniel wrote:Apache is sending out a 404 header when Apache directs the request to the index page. I would highly recommend putting

Code: Select all

<?PHP header("HTTP/1.1 200 OK"); ?>
in index.php, before the headers are sent.
putting that in my index caused Google Sitemaps to not accept my sitemap until I removed it.
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

Make the error docs go to a page that then forwards to the index page.

Code: Select all

ErrorDocument # /errors.php

Code: Select all

# /errors.php
header('Location: http://yoursite.com/index.php');
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

Skara wrote:Make the error docs go to a page that then forwards to the index page.

Code: Select all

ErrorDocument # /errors.php

Code: Select all

# /errors.php
header('Location: http://yoursite.com/index.php');
now that you mention it... i remember most cms type systems use that method.

Thanks :)
Post Reply