Forum Moderators: coopster
This is a PHP/MySQL shopping cart. I'm trying to display all the products for each manufacturer using rewrite for a pretty URL, page sorting of products (price, rating, etc), plus pagination. It started fine, and it works great, but I fear it's going to get dinged for duplication, and I'm worried about the pagination.
My rewrite is basically like: RewriteRule ^American-Widget-Company$ products.php?mfg=awc [L]
My PHP is a mess though. The sorting links look like this (abbreviated):
<a href='{$_SERVER['PHP_SELF']}?mfg=$mfg&sort=ta' rel='nofollow'>Item A-Z</a>, <a href='{$_SERVER['PHP_SELF']}?mfg=$mfg&sort=tz' rel='nofollow'>Item Z-A</a>, <a href='{$_SERVER['PHP_SELF']}?mfg=$mfg&sort=pl' rel='nofollow'>Price Low-High</a>, <a href='{$_SERVER['PHP_SELF']}?mfg=$mfg&sort=ph' rel='nofollow'>Price High-Low</a>
I used "nofollow" because I wanted to make sure that each link was not picked up and triggering duplication. Right or wrong?
I also used $_SERVER['PHP_SELF'] because if I used "American-Widget-Company", I was unable to get the rewrite to work and then it all started getting into a circular headache along the lines of "Why am I trying to make a rewritten URL BACK to a dynamic URL?".
The other similar and related issue is pagination. Will anything be picked up past page 1, and do I use the dynamic URL or the rewritten?
Any help would be most appreciated. I know it's a long one.
Generally dynamic pages are rewritten to look static for search engines. However you are using rel="nofollow" tags on the anchors, so you dont need to worry about optimising those for search engines.
The rel tag is supposed to be used as an identifier for the type of link [w3.org...]
[w3.org...]
however as the contents of this tag can be almost anything and still pass validation people use it for all sorts of stuff. So the nofollow tag is used by most search engines, but not all. Google, Yahoo and MSN all use it, so it is almost an industry standard.
If you are trying to use the nice looking version of the link so that your customers can make a good guess at a url then you need to use the nice non-rewritten static looking link in the <a href=...static looking link> i.e.
<a href='{$_SERVER['PHP_SELF']}?mfg=$mfg&sort=ta' rel='nofollow'>Item A-Z</a>
<a href='/american-widget-company_sort-ta' rel='nofollow'>Item A-Z</a> If I'm using rewrite to change American-Widget-Company to products.php?mfg=awc, my little brainstorm last night was to simply set robots.txt to Disallow products.php. I can't see how that wouldn't solve the entire problem. SE's see American-Widget-Company, but any funky dynamics that products.php wants to do to itself can be done with no fear of duplication penalties since the SE's aren't indexing products.php. Am I missing something or is this too simple?