![]() |
|
Canonical tag or 301 redirect solution - 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: Canonical tag or 301 redirect solution (/thread-11893.html) |
Canonical tag or 301 redirect solution - thud - 2014-07-28 Hi, Please tell me how I can do this. I have added the plugin html_meta_tags but the canonical option is not available (perhaps because im running an old version of this cms and I dont want to upgrade). Can i just upgrade this extension and how? Or can some kind person give me the particular htaccess code i need to do a 301 redirect, the normal code i would write does not work on this site! Many thanks. Canonical tag or 301 redirect solution - acrylian - 2014-07-28 Quote:perhaps because im running an old version of this cms and I dont want to upgrade). Canonical tag or 301 redirect solution - thud - 2014-07-28 Thanks, but can you help me with the 301 redirect code then? I cannot find anywhere where to download the plugin in its own right (and how to install it). You cannot download it from the plugin page on this website. My version: Zenphoto version 1.2.5 [4022] (Official Build) Canonical tag or 301 redirect solution - acrylian - 2014-07-28 Official plugins are tied and made for their release version which is why they are not downloadable separately. You can however get individual files from the GitHub repo. The filter the plugin uses are there since 1.2.3 so maybe it indeed works but there might be dependencies that prevent it. I would really recommend to consider an upgrade, 1.2.5 is really outdated being five years old. That old version might sooner or later break once your server is upgraded by your host. Not to speak of unfixed security issues in old versions. I am not a htacces wizard so I cannot help with such a specific redirection at the moment. MAybe you find some info here: Canonical tag or 301 redirect solution - thud - 2014-07-28 Thanks I will reconsider upgrade, just dont want to lose my custom theme work. I am really just asking 'anyone' how you code a 301 redirect from 1 page to another in this scripts htaccess file as its not standard. Canonical tag or 301 redirect solution - acrylian - 2014-07-28 Quote:Thanks I will reconsider upgrade, just dont want to lose my custom theme work. Not sure what you mean by "not standard". There is no "standard" htaccess as it can be used for lots of things. Those old ZP versions use htaccess extensively for url rewriting which is the reason why "just a redirect" might not be that easy as you think. The current version has much simpler htaccess files. I admit I don't remember the old htaccess file offhand and would have to pull an old release out. Not sure it runs on my servers still. Canonical tag or 301 redirect solution - Jole - 2014-07-31 Hello. I know problem you are talking about. It is problem with all (even new) versions of ZenPhoto CMS. In older versions "/album-name" was standard url, but you could open same category with "/album-name/". Today standard is "/album-name/" but if you remove trailing slash you can open same category with "/album-name". I have this 301 (SEO) redirection rules in my .htaccess file, and it is working exactly what you wish, it redirects "/album-name" to "/album-name/". Make sure that static files and some pages do not get a slash added (images, search results, contact, register pages...)RewriteCond %{REQUEST_FILENAME} !-f Exludes some urls that do not need trailing slashRewriteCond %{REQUEST_URI} !.pages Add trailing slash when a url do not contain a trailing slash with SEO 301 redirectionRewriteCond %{REQUEST_URI} !(.)/$ I hope this will help you too. Canonical tag or 301 redirect solution - acrylian - 2014-07-31 Thanks that hopefully will help thud above. I think though if you set the canonical tag in the `` it should really not be a problem. Google got quite clever nowadays. Btw, depending on what formats you use you might need to add more suffixes as video and audio formats are missing above. Canonical tag or 301 redirect solution - MarkRH - 2014-07-31 The following two lines will probably also work (seem to on my gallery) for adding trailing slashes to those things that need it: Canonical tag or 301 redirect solution - acrylian - 2014-08-01 That lools much better. I guess we can add that by default. Canonical tag or 301 redirect solution - Jole - 2014-08-01 I did not tested MarkRH's solution, but it would be great to have something like that (tested first, of course), or some combination with my rules in standard .htaccess file. In my solution I added extensions that I use on my site (image gallery only, without video or audio files). If someone has some audio/video files in use on website I advice to add those extensions as well on list. Canonical tag or 301 redirect solution - sbillard - 2014-08-01 Do not forget that dynamic albums have a .alb suffix. |