Forum Moderators: coopster

Message Too Old, No Replies

Possible duplication issues and pagination

Dynamic pages meet redirection meet rewrite

         

salewit

1:55 am on Nov 21, 2007 (gmt 0)

10+ Year Member



I've got a mess on my hands!

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.

PHP_Chimp

10:47 pm on Nov 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is a little late, so im not sure if I have got all of the points you wanted answered. However here is a go at answering -

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>

Needs to become -
<a href='/american-widget-company_sort-ta' rel='nofollow'>Item A-Z</a>

RewriteRule ^american-widget-company_(.*) products.php?mfg=awc&sort=$1 [L]
Or -
You may be able to use the QSA flag on the rewrite rule to construct a query string bit by bit. Have a look at [webmasterworld.com...] as it may give you some ideas.

salewit

12:05 am on Nov 22, 2007 (gmt 0)

10+ Year Member



Thanks so much! No it's definitely not too late. I was tossing and turning all night trying to figure this one out.

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?

PHP_Chimp

5:00 pm on Nov 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



using robots.txt will (should...) block all of the search engines, the rel will block the larger ones. However it is a lot easier to write 1 line in robots.txt than it is to remember to put the rel="nofollow" after all of the tags and you may want to do something with the rel tag in the future, so may as well keep it free.