%path% in "Download Item" URL rewrite

spidermite

Joined: 2007-03-01
Posts: 5
Posted: Thu, 2007-03-01 12:56

Hi, ive just installed gallery for the first time and im very impressed. I used to use zoom gallery for mambo but it pails in comparison.

A major benefit is the URL rewriting, its gonna be great for search engines. One thing i cant seem to do is put the %path% variable in the "download item" direct link to the jpg thumb. I want to do this to lure the google images spider.

So it would look like

http://www.mysite.com/gallery/albumname/imagename-%serialNumber%-%fileName%.jpg

I had a search about and found user(admin?) pelle saying it was easy in this thread:
http://gallery.menalto.com/node/44359

"The easy out of the box solution, make %path% possible for download requests. The URL would then look something like /d/123-4/album/subalbum/image.jpg"

But havent found any examples of how to implement it, the url rewrite admin page stops you from adding %path% to download items. Any ideas?

Many Thanks

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-03-01 14:46

- what version of g2 are you using? (site admin -> system information)
- what version of the rewrite module are you using (g2.2: site admin -> plugins, g2.1: site admin -> modules)?

the %path% keyword isn't available for download-item URLs. it's only available for showitem (the HTML pages) URLs.

for download-item urls, you can use %fileName%. e.g. d/%itemId%-%serialNumber%/%fileName%
note: you need to include the %itemId% in the short URL. else g2 will add &g2_itemId=... to your URLs.

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

 
spidermite

Joined: 2007-03-01
Posts: 5
Posted: Thu, 2007-03-01 15:13

Hi, thanks for the quick reply. I am using gallery version 2.1.2 and URL Rewrite version 1.1.4.

I noticed %path% isnt out-of-the-box available, but i thought id see if there was a hack to enable it. The benefits from google images traffic would be well worth the trouble, the google spider loves keywords in image names. Ive looked at older versions of gallery and up to 1.4 file paths seem to include the album name.

Im also not concerned about people downloading or hotlinking my images, i prefer to keep my photos open and hope they spread.

Is there a quick hack to allow the %path% as an "additional keyword" alongside the required ones?

Cheers

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-03-01 16:18

the path is included in the showitem URL -> HTML pages where the downloaditem URLs are embedded in.
the context is sufficient for google to figure out that your download-item url is associated with that album / its path / name.

i don't think there's a quick hack documented to get %path% in download-item urls.
maybe someone else did it already or has the time to provide you with instructions to apply this change.

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

 
spidermite

Joined: 2007-03-01
Posts: 5
Posted: Thu, 2007-03-01 16:35

Thanks for your help. There is context on the pages, but to really feed the spider juicy bits its very useful to have the keywords provided in the albumname in the filename itself.

On any popular search term, most of the top results will have the keyword in the filename and the directory structure. Take this search for firefox for example:
http://images.google.co.uk/images?hl=en&q=firefox&btnG=Search+Images&gbv=2

Ive been looking in the gallery database, the inputted %keywords% are kept in g2_PluginParameterMap under activeRules. Ive tried adding %path% directly to the db but it wont stick.

Any idea if this would this be sufficient or would i have to add or modify another htaccess rule?

Cheers