?g2_serialNumber on image urls...is this really necessary?

ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Sun, 2007-04-01 20:02

I noticed today that my image urls have grown even longer, for example:

Src=/images/us-capitol-building?g2_itemId=1259&g2_serialNumber=14

What does the serial number do and is there any way to remove it without changing the code? All of these appended parameters make it more difficult for the images to be indexed properly and also to rank well.

Thanks

Andrew

AP Fine Art Photography New York

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-04-01 20:43

%itemId% and %serialNumber% must both be part of the URL pattern for the download item URL rule.
(and they are by default)

else g2 adds them as URL parameters, as you see.

the reason for that is that g2 can't handle the download URLs very efficientely if the $itemId parameter isn't part of the url. to compare, use pathinfo instead of mod_rewrite and enable the download item rule. you'll see that the server load and response times will go up.

the serialNumber is required to deal with browser-caching. e.g. if an album or photo thumbnail changes, the URL will be different, e.g. 15-2 instead of 15-1, thus the browser won't use the cached image.

it was always like that in g2, that hasn't been changed recently.
i guess you just experimented with your url patterns recently and that's why you see this now.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Tue, 2007-04-03 18:12

Ah, I replaced the %itemId% and %serialNumber% paramters and see what you mean...the us-capitol-building?g2_itemId=1259&g2_serialNumber=14 becomes us-capitol-building/1259/14...much nicer. I didn't realize this when I edited the paramter in URL rewrite and now I am stuck with the longer versions. If I change any part of the download url all of the images in my Zen Cart store break. This is a major problem with the Zen Cart module, which doesn't have the capacity to automatically update the URLS. You have to turn the module off and on again and it grabs the new urls. That would be simple enough but the problem is that you lose any and all customization info that you have created and you have to enter them all again manually...i.e. print sizes, framing options, etc. The Zen Cart module is wonderful in what it does do, but very limited in it's flexibility. Hopefully someone will pick up development of the module again and make it compatible with newer versions of Zen Cart.

On another note...I have recently had all of my images disappear from the Google images index. That dropped my traffic by 25% in one shot and I see no signs that google is reindexing my images. I noticed I have two conflicting bits of code in my htaccess file and I'm wondering if this might have something to do with it:

RewriteCond %{QUERY_STRING} view=core.DownloadItem
      RewriteCond %{QUERY_STRING} itemId=([0-9]+)
        RewriteCond %{HTTP_REFERER} !://andrewprokos.com/ [NC]
        RewriteCond %{HTTP_REFERER} !^$
      RewriteRule .   /index.php?g2_view=rewrite.DownloadItem&g2_itemId=%1   [L]
RewriteCond %{THE_REQUEST} \ /d/([^\/\?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/index\.php$
    RewriteRule .   /index.php?g2_view=core.DownloadItem&g2_fileName=%1   [QSA,L]

Do these two entries somehow conflict with each other?

Thanks for the help

Andrew
New York City / Washington DC Photographer

 
ichthyous

Joined: 2006-06-16
Posts: 324
Posted: Thu, 2007-04-05 19:12

No response to this?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-04-05 19:54

no, there shouldn't be any conflict between those rules.
you can check it by using both url styles and see if they still lead to the correct image.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage