JavaScript Editor Ajax software     Free javascripts 



Main Page

is specifically written to take parameter order into consideration. Here is an example where a PHP web
site would generate the exact same content, but using different URLs:
http://www.example.com/catalog.php?product_id=1&category_id=2
http://www.example.com/catalog.php?category_id=2&product_id=1
If the
catalog.php
script accesses the parameters as
$_GET[‘product_id’]
and
$_GET[‘category_
id’]
, respectively, these two different URLs would generate the same content. There’s no standard spec-
ifying that URL parameters are commutative. If both dynamic links are used within the web site, search
engines may end up parsing different URLs with identical content, which could get the site penalized.
In conclusion, it’s wise to be consistent and follow a standard parameter order to avoid problems and
improve your rankings. Consider an example where the parameter order may make a difference:
http://www.example.com/compare_products.php?item[]=1&item[]=2
http://www.example.com/compare_products.php?item[]=2&item[]=1
Here, the parameter name is
item
, and it’s used to populate a PHP array called
$_GET[‘item’]
. In the
former case the item array contains (1,2), and in the latter it contains (2,1). In this case, a search engine
cannot assume these URLs are equivalent — and indeed they may not be.
The programmer should also try to use consistent capitalization on file names and query strings. Search
engines resolve such simple differences, especially because file names in Windows are not case sensitive,
but the following URLs are technically different in both Windows and Unix operating systems:
http://www.example.com/products.php?color=red
and
http://www.example.com/PRODUCTS.php?color=RED
Your script may recognize the equivalence of those URLs, but a search engine may not. Again, main-
taining a consistent style is desirable. The developer should also try to reference directories in a web
site with the trailing “/” consistently. For example, if you’re using numeric rewritten URLs, it would
be best to avoid referencing a particular product using both of the following links, even if your script
can successfully parse them:
http://www.example.com/Products/1/
and
http://www.example.com/Products/1
In practice, search engines
can
resolve many of these ambiguities. Matt Cutts asserts that Google can “
do
things like keeping or removing trailing slashes, [and try] to convert URLs with upper case to lower case
” (
http://
www.mattcutts.com/blog/seo-advice-url-canonicalization/
), but this is only a subset of the
aforementioned ambiguities. It is best to remove all of the offending ambiguities regardless.
In order to enforce consistency as a whole, you can create a function for each type of URL required by
a site. Through the logic in that function URLs are consistently formatted. As you will see in Chapter 5,
45
Chapter 3: Provocative SE-Friendly URLs
c03.qxd:c03 10:39 45


JavaScript Editor Ajax software     Free javascripts 
R7