Forum Moderators: coopster

Message Too Old, No Replies

Is example.com/10K better than example.com?race=10k?

Eliminating URL parameters with PHP

         

RoadRaceResults

6:50 pm on Mar 23, 2005 (gmt 0)

10+ Year Member



Is example.com/10K better than example.com/1.php?race=10k?

In other words, is it really worth the effort to eliminate URL parameters.

If so, is there a way to get treat the 10K in the first one as 10K.php?

When using PHP in particulat, is there a way to eliminate URL parameters in IIS without having tons of subdirectories - one for each script.

I'm hoping someone out there has experience with this.

Thanks
David Brooks

[edited by: pageoneresults at 7:05 pm (utc) on Mar. 23, 2005]
[edit reason] Examplified URI References and Removed Email Signature [/edit]

GeorgeK

10:53 pm on Mar 23, 2005 (gmt 0)

10+ Year Member



Search Google for "iis mod rewrite" (without the quotes), and that should lead you in the right direction.

moltar

11:20 pm on Mar 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



User/Search engine friendly URLs are definitely better.

SEF URL [google.com]

gilahacker

1:21 am on Mar 24, 2005 (gmt 0)

10+ Year Member



while google and the other search engines will cache urls with parameters, I've noticed they don't always get them and they don't rank well...

on my site I had urls like this:

[webmasterworld.com...]

and google would spider most of those pages, but they didn't rank so great, if at all...

changing the urls to look like this:

[webmasterworld.com...]

Got me a number 5 ranking in google for that company's name.

In my case it was as easy as buying an addon for the content management system I use (called mambo), there are definitely ways of doing it through mod rewrites, but I am no master at them...

look for jdMorgan under the "Apache Web Server" section of this site, he's the friggin god of mod rewrite...

[webmasterworld.com...]

-Jason

(note, as the urls shown above are underlined, it looks like there are spaces in my urls, they are in fact underscores "_")

[edited by: coopster at 4:10 am (utc) on Mar. 24, 2005]
[edit reason] examplified company name [/edit]

first_hf

2:51 pm on Mar 24, 2005 (gmt 0)

10+ Year Member



# would there be some difference in SERP ranking for
www.example.com/widget1.asp
and
www.example.com/widget1
# To put it in otherwords would the files in subdirectories get less ranking than that of the ones in root directories?
# By having this structure(www.example.com/widget1), I have the freedom to change the file extensions say htm or php or asp anytime without affecting the ranking.
# Would google rank .asp or php files lower than what it would rank .htm files?

Suggestions please..

gilahacker

9:48 pm on Mar 24, 2005 (gmt 0)

10+ Year Member



@first_hf

I'm not sure on this one...

I'm not using any file extensions at the end, they all look like directories...

I will say that for the company whose name I rank number 5 for on google, number one is www.examplecompany.com, #2 is a .htm, #3 is a .cfm?s_booth=88654, and #4 is a .asp, whereas number 5 (me) and number 6 (yahoo) are both directory style and #6 is a .html

best I can tell it makes no real difference, personally I think the directory method looks cleaner but there's so many factors involved in ranking I couldn't say for sure if google (or others) really care about the file type.

-Jason

jatar_k

9:54 pm on Mar 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have seen no evidence that any extension, or lack there of, will out perform any other in regards to rankings.

RoadRaceResults

10:42 pm on Mar 24, 2005 (gmt 0)

10+ Year Member



My host won't install IISRewriter.
How about if I use:

<?
Header( "Location: 1.php?id=12345" );
?>

to redirect from example.com/friendly-name.php

What will the spider 'see'?

Since in the browser the address changes from friend-name.php to 1.php?id=12345 ?

Thanks
DRB

jatar_k

11:47 pm on Mar 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the spider will see a redirect but you could set your vars and include the template

$id = 12345;
include '1.php';

and then use $id instead of $_GET['id']

RoadRaceResults

1:38 am on Mar 25, 2005 (gmt 0)

10+ Year Member



I don't know if that will really help because then the spider will still see 1.php which isn't the page topic.
The page topic is /friendly-name.php
which translates to some url id parameter that is used as a database query.
The id isn't descriptive.
I would give the actual example but this forum removes all specifics and replaces it with generic stuff.

Thanks
DRB

first_hf

1:48 am on Mar 25, 2005 (gmt 0)

10+ Year Member



Would the google rank the files in deeply burried directory/subdirectory , low and the files in the root, high... is that true?..
Example :

www.example.com/products/categories/portable/widget1/
www.example.com/portable_widget1.php

gilahacker

2:02 am on Mar 25, 2005 (gmt 0)

10+ Year Member



I think it's not so much the directory depth but how many links deep from your homepage that google has to go to get to it.

RoadRaceResults

2:46 am on Mar 25, 2005 (gmt 0)

10+ Year Member



So in that case it may be good to use subdirectory names as a way to include all the right keywords in the URL.
Would this help bump up the frequency and importance of those keywords?

David

RoadRaceResults

2:58 am on Mar 25, 2005 (gmt 0)

10+ Year Member



I found a good solution to the Spider Friendly URL redirect problem when IIS Rewrite isn't available.

In the spider-friendly-keywords.php page simply put:
<?php
$spiderFriendlyParms = array ( 'id' => '12345' );
include 'generic-script-name-with-parameters.php';
?>

Then in 'generic-script-name-with-parameters.php' put:

if( isset( $spiderFriendlyParms ) )
{
foreach( $spiderFriendlyParms as $key => $value )
{
$_GET[$key] = $value;
}
}

(of course, I could just use array_merge() as well)
This allows the parameters to get passed into the actual PHP page using global vars and then they are copied into the $_GET array so the script can't tell the difference.

It works well. Now I just need to automatically generate one of these stub Spider-Friendly-Keywords.php pages for all the possible parameter values that could be sent to the database query.
In my case that is a few hundred of them.

David