ZenphotoCMS Forum
Tweaking SEO options - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Tweaking SEO options (/thread-13024.html)

Pages: 1 2


Tweaking SEO options - undagiga - 11-10-2017

Hi. New user, first post. I'm migrating a photo site from Gallery3 to ZenPhoto. In Gallery3 I had some SEO optimisations that set album URLs to end in .html rather than /. In hindsight that probably wasn't smart, but at least there's not so many of these so I can probably deal with them via server redirects. The bigger problem is the image pages. The urls I had in Gallery3 were:

www.mysite.com/album/imagexxx.html

whereas ZenPhoto results in

www.mysite.com/album/imagexxx.jpg.html

Are there any suggestions for how I might deal with this? Where would I hack the mod rewrite code to do this? I could perhaps edit the .htaccess, but like others I find this difficult and confusing.




Tweaking SEO options - undagiga - 11-10-2017

Due to restrictions on the length of posts, I had to edit the following vote of thanks out of the initial post.

My congratulations to the team for such a great piece of software, especially Stephen Billard whose work I'm already familiar with from QTRGui, and to Vincent for the zpArdoise theme. I did a fair bit of customisation and hacking of Gallery3 so I'm able to resolve most of my issues myself, but have a few questions where some help would be appreciated.




Tweaking SEO options - acrylian - 12-10-2017

Thanks! Please note that Stephen Billard is not involved in Zenphoto anymore.

Sorry for the post limit but that's to help against spam. It should only apply on the first post(s).

Zenphoto's single image urls are always www.mysite.com/album/imagexxx.jpg.html. The .jpg suffix is required because you could also have images like imagexxx.png or imagexxx.gif or even non image files like imagexxx.mp4. Without the suffix Zenphoto would not know which it should use.

You would have to put redirection from the old urls to the new ones right at the beginning of the htaccess file.




Tweaking SEO options - acrylian - 12-10-2017

To add: Also the .html suffix (called modrewrite suffix on Zenphoto which can be customized) is required as otherwise search engines think these are pages pretending to be images which naturally is bad for SEO as well.




Tweaking SEO options - undagiga - 12-10-2017

Thanks. My images are all JPG, in which case I could presumably hack the code to do the image redirect and assume JPG. That may or may not be a great idea long-term. It may be better to generate a new sitemap asap rather than rely on a fairly deep hack long-term. I guess the question is how many hard links there are out there in the wild to individual images. If it's not so many I could also redirect them via the server.

[I realised that Stephen Billard is a former team member, but I thought perhaps that he still visited and read the forum.]




Tweaking SEO options - acrylian - 12-10-2017

It would indeed not be a good idea to hack this in the code as the url generation is really core stuff. That may result in other issues.

You could surely redirect your old links via htaccess to the new ones. Especially if the old links all are jpg that would be quite easy. Otherwise it would have been quite impossible.

Not familiar with Gallery but the only problem might be if Gallery's album urls are the same. Then there is no way to differ between album and image.




Tweaking SEO options - sbillard - 12-10-2017

I do still visit the forum. The "jpg" bit is there because zenphoto supports multiple types of images (jpg, png, etc.) and needs to know the full name of the image in order to find it. If you have only jpg images you can check the "unique image" option and the suffix will be removed from the links.




Tweaking SEO options - acrylian - 12-10-2017

As I explained above already. Zenphoto actually has no "unique image" option.




Tweaking SEO options - sbillard - 12-10-2017

It should.




Tweaking SEO options - undagiga - 12-10-2017

I agree with Stephen. xxxx.jpg.html looks funny to me, especially if it's redundant, which is probably why I opted to remove the jpg part in Gallery3.

It's still only early days, but one thing I like about ZenPhoto is its relative simplicity. I probably made the mistake with Gallery3 of too much customisation, plus I had to rely on some fairly flaky plugins that in effect did deep hacks to the base code to do simple things like virtual albums. Out of the box ZenPhoto seems to work much closer to what I want, especially when some of the supported plugins are enabled (most of the key ones for me have Stephen's name on them). So I hope to have a simpler life with a less customised and hacked web gallery install that I used to have.

That said, I'd vote for a "unique image" option.




Tweaking SEO options - acrylian - 13-10-2017

Sorry, no plans for such an option currently.

But we may have a general url change for image page urls in the future. But too early to tell as this can have several drawbacks.




Tweaking SEO options - MarkRH - 17-10-2017

Well, I actually moved my gallery from Gallery3 to Zenphoto and my image pages ended with "/" so my .htaccess rewrite rules were kind of funky since album pages also ended on "/". The one that catches most of the image pages is:

RewriteRule ^(misc-pics|my-vehicles|home-theater|cindy-crawford|danica-patrick|humorous|ibm-party|trips/bass-pro-shop|planetary-society-and-seti|getglue-stickers|nature)/(.*)/$ $1/$2.jpg.php? [NC,R=301,L]

So yours would be something like

   RewriteRule ^(album1|album2)/(.*)\.html$ $1/$2.jpg.html? [NC,R=301,L]



Tweaking SEO options - acrylian - 17-10-2017

Thanks @MarkRH, always good if someone with the same problem/setup helps out.




Tweaking SEO options - undagiga - 17-10-2017

Agreed. Thanks. I guess I could do something similar and use a similar kind of rewrite rule to put the jpg in a url if it's not already there, which would deal with the redirect issue.

What it won't deal with is the Facebook issue, because unless I can construct URLs exactly as I had them, I've lost all the FB likes and FB comments. At the moment I'm stuck with that as part of the migration.




Tweaking SEO options - acrylian - 17-10-2017

I am not sure but won't those still work if redirected?




Tweaking SEO options - undagiga - 17-10-2017

In short no. I could use the RewriteRule to turn a requested imagepagexxx.html into imagepagexxx.jpg.html in order to do the redirect, but that jpg-based url is what the Facebook code sees, whereas it was the jpg-less URL that was liked previously.

I need the reverse of the RewriteRule. I'd need to take the jpg out of the Zenphoto URL for FB to recognise it. I guess I could take the jpg out in the PHP code that inserts the FBcode. Hmmmm......... Maybe .....




Tweaking SEO options - acrylian - 17-10-2017

I am not that familiar but isn't there is a way to update the url on FB, too, so you don't loose everything?




Tweaking SEO options - MarkRH - 17-10-2017

For the actual images, I used some thing like:

   RewriteRule ^var/(resizes|albums)/(.*)\.(jpg|gif|flv|html|php|png)(.*)$ cache/$2_w520.$3? [NC,R=301,L] 
   RewriteRule ^var/thumbs/(.*)\.(jpg|gif|flv|html|php|png)(.*)$ cache/$1_150_cw150_ch150_thumb.$2? [NC,R=301,L] 

Now to get this to work I had to modify my theme to use a constant width image of 520. Also had to use my own versions of some functions to deal with just the width of 520 and no height in the image URL; otherwise, I could not predict what an image's URL would be as the hXXX part would always be different.




Tweaking SEO options - undagiga - 17-10-2017

I did a little research and found this article on keeping likes etc when content is migrated to a new url:

https://developers.facebook.com/docs/sharing/webmasters/crawler#updating

The problem with this is that it seems to require the old site to co-exist, and I can't readily do that. I'll need to consider ways of fooling it. There are a couple of options that come to mind.

@MarkRH : I'm not sure why I need to redirect image requests. I'm mostly concerned about links that I have posted around to album and image pages. I thought that if these redirect then the images should take care of themselves. I don't think that there are any links to to actual images. I guess a Google images search will have broken links for a while, but that concerns me less in my case.




Tweaking SEO options - acrylian - 18-10-2017

Actually the normal way to update any crawler is to setup 301 redirect as @markRH did. The old site does not need to co-exists actually since you are catching the old urls and direct them to the new ones.

The redirection of the images could also be important because FB & Co use them to embed them. Zenphoto caches images so the originals are not used so on these embeds the image may also be broken otherwise.