| Google Forum Discuss Google related issues. |
02-26-2004, 04:34 PM
|
#1 (permalink)
|
|
Moderator
Join Date: 01-11-04
Location: Folsom
Posts: 2,645
|
Google Following PHP Pages - Question
Ok - more and more of my pages are .PHP now and the more dynamic I can make the site the easier they are for me.
My question is can google follow the hyerlinks and spyder the page content.. pages such as
mysite.com/icons.php?page=1
then on the bottom of that page it says
mysite.com/icons.php?page=2
Will google know to goto page 2? Or should I learn howt o use mod_rewerite to allow google to index better?
I am making a search engine for some sites and will contain a "DIRECTORY" url that will have all searched keywords added, so that google can spyder it easier but if the above doesn't work then I have to think of something new..
|
|
|
02-26-2004, 04:50 PM
|
#2 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
Google can follow it without much of a problem. When it can't follow it well is when there are things like session ids. I'm sure someone will have a better explanation that just that. 
|
|
|
02-26-2004, 05:15 PM
|
#3 (permalink)
|
|
Moderator
Join Date: 01-11-04
Location: Folsom
Posts: 2,645
|
Ok, so as long as I don't use Sessions I`m ok?
On another note, on another site of mine I do use sessions to keep track if a user is logged in or not, but would this limit google from following pages that just 'start' a session but don't track the user or track session variables at all?
|
|
|
02-26-2004, 05:37 PM
|
#4 (permalink)
|
|
v7n Mentor
Join Date: 12-02-03
Location: Valparaiso, Indiana
Posts: 668
|
Try not to go over using more then 2 variables in your site. page=2 is fine. If a session is required then google can't spider it.
|
|
|
02-26-2004, 06:00 PM
|
#5 (permalink)
|
|
Moderator
Join Date: 01-11-04
Location: Folsom
Posts: 2,645
|
Thanks!
What about
variable=bla|bla|bla|bla|bla
where I use my own parser to detect multiple variables?
|
|
|
02-26-2004, 08:29 PM
|
#6 (permalink)
|
|
v7n Mentor
Join Date: 12-02-03
Location: Valparaiso, Indiana
Posts: 668
|
I have one site that does that, it does get listings, but it doesn't seem like that last long or go up high.
|
|
|
02-26-2004, 09:08 PM
|
#7 (permalink)
|
|
Moderator
Join Date: 01-11-04
Location: Folsom
Posts: 2,645
|
Gotcha, I`ll try to keep it to one variable.
Or better yet I may do something like
mysite.com/keyword.php
Where keyword is the term searched, then hard code that in...
Options 
|
|
|
02-26-2004, 09:27 PM
|
#8 (permalink)
|
|
Inactive
Join Date: 10-20-03
Location: San Diego, California
Posts: 271
|
You could get a little tricky too with a mod_rewrite (if you are using Apache as your web server). So instead of having a bunch of php files (one for each keyword), so it like this:
have a .htaccess file with something like:
RewriteRule ^([a-zA-Z]+)\.html$ /keywords.php?word=$1 [L]
Then any .html file you have within that directory will simply be rewritten on the backend. For example the user's browser requests phonebook.html, and even though that file never actually exists, on the backend it's rewritten as /keywords.php?word=phonebook
Makes it much cleaner if you are going to have a lot of pages that are dynamic...
- Shawn
|
|
|
02-26-2004, 09:38 PM
|
#9 (permalink)
|
|
Moderator
Join Date: 01-11-04
Location: Folsom
Posts: 2,645
|
Quote:
|
Originally Posted by digitalpoint
You could get a little tricky too with a mod_rewrite (if you are using Apache as your web server). So instead of having a bunch of php files (one for each keyword), so it like this:
have a .htaccess file with something like:
RewriteRule ^([a-zA-Z]+)\.html$ /keywords.php?word=$1 [L]
Then any .html file you have within that directory will simply be rewritten on the backend. For example the user's browser requests phonebook.html, and even though that file never actually exists, on the backend it's rewritten as /keywords.php?word=phonebook
Makes it much cleaner if you are going to have a lot of pages that are dynamic...
- Shawn
|
That's what I need! How do I learn about doing that because I run TONS of my own websites, and 90% are all PHP and look terrible for search engines...
Where do I learn to do this?
And can I have different mod_rewrite's for each site?
|
|
|
02-27-2004, 04:15 AM
|
#11 (permalink)
|
|
Contributing Member
Join Date: 10-14-03
Location: The World
Posts: 223
|
Recently I took a look at osCommerce, the GPL shopping cart.
I don't have url rewriting on my server, so I was sad. osCommerce programmers made me happy. SE "friendly" php urls without rewriting ...
It looks like this:
http://www.somesite.com/some-php-pag...i/33/c/14/pn/1
normal it would look like this
http://www.somesite.com/some-php-pag...i=33&c=14&pn=1
I checked osCommerce sites an google likes those kind of urls.
Currently I am "learning this trick". next sites will be done like this...
Maybe the rest in coding, once....
|
|
|
02-27-2004, 07:07 AM
|
#12 (permalink)
|
|
Inactive
Join Date: 01-12-04
Posts: 999
Latest Blog: None
|
With my shopping cart I am writing the system so that it creates static pages as well as dynamic pages. I have also considered the rewrite since it really is a great idea.
|
|
|
02-27-2004, 09:18 AM
|
#13 (permalink)
|
|
Inactive
Join Date: 10-20-03
Location: San Diego, California
Posts: 271
|
Quote:
|
Originally Posted by Gede
|
It sure looks like they are rewriting the URLs to me... Are you sure they aren't using mod_rewrite to do it? There is no .htaccess file in your oscommerce directory?
- Shawn
|
|
|
02-27-2004, 10:25 AM
|
#14 (permalink)
|
|
Contributing Member
Join Date: 10-14-03
Location: The World
Posts: 223
|
No, no rewrite,
basicly it comes down to this:
From my experiments: (You speak php so...)
[code:1:d9c0309b7c]$basesite="http://pemaron/sehot/";
if (strlen(getenv('PATH_INFO')) > 1) {
$GET_array = array();
$PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
$vars = explode('/', substr(getenv('PATH_INFO'), 1));
for ($i=0, $n=sizeof($vars); $i<$n; $i++) {
if (strpos($vars[$i], '[]')) {
$GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];
} else {
$HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];
}
$i++;
}
if (sizeof($GET_array) > 0) {
while (list($key, $value) = each($GET_array)) {
$HTTP_GET_VARS[$key] = $value;
}
}
}
$p=$HTTP_GET_VARS[p];
$pn=$HTTP_GET_VARS[pn];
$c=$HTTP_GET_VARS[c];
$i=$HTTP_GET_VARS[i];
$r=$HTTP_GET_VARS[r];
function ref_link($slink) {
$slink = str_replace('?', '/', $slink);
$slink = str_replace('&', '/', $slink);
$slink = str_replace('=', '/', $slink);
$slink = str_replace(' ', '-', $slink);
return $slink;
[/code:1:d9c0309b7c]
|
|
|
02-27-2004, 10:29 AM
|
#15 (permalink)
|
|
Inactive
Join Date: 10-20-03
Location: San Diego, California
Posts: 271
|
Ah... yep, that definitely would work...  I forgot that you can expand on the php filename and the right PHP file still responds...
- Shawn
|
|
|
02-27-2004, 08:30 PM
|
#16 (permalink)
|
|
Contributing Member
Join Date: 10-14-03
Location: The World
Posts: 223
|
I have put some of the osCommerce stuff in here:
http://www.balihotelguide.com/
Curious how it works out...
|
|
|
02-27-2004, 08:41 PM
|
#17 (permalink)
|
|
Banned
Join Date: 01-23-04
Posts: 2,367
Latest Blog: None
|
Im using session's anyway. Google gonna tell me to go screw myself then they can die. Tons of people will be linking to my site anyway and most page ranks are first page and google will list the first page of my site. So as long as they shows up on search engines, it should be fine.
How you gonna show logged in user's without sessions?
1) Include it in the URL
?User=What&Pass=Who
2)Store it on server with time out from IP
|
|
|
02-27-2004, 08:42 PM
|
#18 (permalink)
|
|
Inactive
Join Date: 10-20-03
Location: San Diego, California
Posts: 271
|
... or us a cookie instead...
- Shawn
|
|
|
02-27-2004, 08:46 PM
|
#19 (permalink)
|
|
Banned
Join Date: 01-23-04
Posts: 2,367
Latest Blog: None
|
What about people who have cookie's disabled?
You cant create a cookie after print html to a page, so it gets really complicated.
|
|
|
02-27-2004, 09:21 PM
|
| |