JavaScript Editor Ajax software     Free javascripts 



Main Page

The rule matches any random set of characters followed by -M (
^.*-M
), followed by a group of digits
that is captured as $1 —
([0-9]+)
. Next you have a literal dot —
\.
(note that it’s escaped using the
backslash), and followed again by a random set of characters — (
.*
).
In English, the rule matches URLs such as
Some-Media-Name-Mn.some-extension
, and rewrites them
directly to a physical file
/media/
n
.
The new function you’ve added to the URL factory generates such beautified URLs. In case you want to
use search engine friendly image file names, you should either give them proper names from the start,
or use the URL factory together with the rewriting rule to ensure consistency throughout the web site.
Problems Rewriting Doesn’t Solve
URL-rewriting is not a panacea for all dynamic site problems. In particular, URL-rewriting in and of
itself does not solve any duplicate content problems. If a given site has duplicate content problems with
a dynamic approach to its URLs, the problem would likely also be manifest in the resulting rewritten
static URLs as well. In essence, URL-rewriting only obscures the parameters — however many there
are, from the search engine spider ’s view. This is useful for URLs that have many parameters as we
mentioned. Needless to say, however, if the varying permutations of obscured parameters
do not
dic-
tate significant changes to the content, the same duplicate content problems remain.
A simple example would be the case of rewriting the page of a product that can exist in multiple cate-
gories. Obviously, these two pages would probably show duplicate (or very similar content) even if
accessed through static-looking links, such as:
http://www.example.com/Products/College-Books-C1/Some-Book-Title-P2.html
http://www.example.com/Products/Out-of-Print-Books-C2/Some-Book-Title-P2.html
Additionally, in the case that you have duplicate content, using static-looking URLs may actually exacer-
bate the problem. This is because whereas dynamic URLs make the parameter values and names obvious,
rewritten static URLs obscure them. Search engines are known to, for example, attempt to drop a parame-
ter they heuristically guess is a session ID and eliminate duplicate content. If the session parameter were
rewritten, a search engine would not be able to do this at all.
There are solutions to this problem. They typically involve removing any parameters that can be avoided,
as well as excluding any of the remaining the duplicate content. These solutions are explored in depth in
Chapter 5.
A Last Word of Caution
URLs are much more difficult to revise than titles and descriptions once a site is launched and indexed.
Thus, when designing a new site, special care should be devoted to them. Changing URLs later requires
you to redirect all of the old URLs to the new ones, which can be extremely tedious, and has the poten-
tial to influence rankings for the worse if done improperly and link equity is lost. Even the most trivial
changes to URL structure should be accompanied by some redirects, and such changes should only be
made when it is absolutely necessary.
75
Chapter 3: Provocative SE-Friendly URLs
c03.qxd:c03 10:39 75


JavaScript Editor Ajax software     Free javascripts 
Bitcoin Dice Site