Album.php uses getGalleryIndexURL this way `<?php echo html_encode(getGalleryIndexURL());?>` and the trailing / displays in the resulting links URL.
The print_album_menu function uses getGalleryIndexURL this way `echo "
".$indexname."";` and the trailing / does not display in the resulting links that are displayed if printAlbumMenu is on.
That means links to the same pages can be seen as duplicate content, one link with the trailing / and one without that both go to the same page.
How do I add a trailing / to the print_album_menu function?
Thank you for any help
Warren
Comments
http://www.warrendiggles.com/photography/colorado-wedding
Link from album.php:
http://www.warrendiggles.com/photography/colorado-wedding/
I ran a test using SEOMoz crawler and it shows that these two different links point to duplicate content, my research shows that google will consider it duplicate content as well. For example google sees these url variations as duplicate content even though they all end out on the same landing page:
warrendiggles.com
www.warrendiggles.com
www.warrendiggles.com/
www.warrendiggles.com/index.html
How do I add a trailing slash to this snippet in the plugin `(html_encode(getGalleryIndexURL()))`
I tried "/" adding {echo "/"} ."/". a bunch of variations but could not get it to work.
Thank you for your help
You have not provided the full code, but I presume you should use: `(html_encode(getGalleryIndexURL())).'/'` if you wish to add the slash.
Were you able to modify the print_album_menu plugin? Did you get the trailing slash to display? I tried sbillard's suggestion without success. Can you provide the full code you used? I am using zenphoto version 1.4.0.3 [6817] (Official Build) THEME: zpfocus_v1.4.
Thank-you! Renee
I tried variations of sbillard's suggestion without success either, here is the full code so if Mr. Billard will help again hopefully it will be more clear to us..
`
if($option === "list" OR $option === "list-top") {
if(!empty($indexname)) {
echo "".$indexname."";
}
}
`
Thank you!
Warren
##### put no rules before this line #######
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)([^/])$ http://www.domain.com/zenphoto/$1$2/ [R=301,L]
Of course insert your site info into the http://www.domain.com/zenphoto/$1$2/
This post shows how to add the trailing slash to every url, you can also remove the trailing slash. Here is a link to the website I got the info from:
http://blog.valtersboze.com/2009/06/add-or-remove-trailing-slash-in-url-with-htaccess/
This code worked fine for my menu items, but my theme is ZPfocus_v1.4 , zenphoto version 1.4.0.3 [6841] (Official Build) and I use the zenpage plugin for News, Pages and Categories. When I add the rule to my .htaccess file it returns a 404 page not found error for anything except the menu items.
Do you have any issues with this rule?
Thank-you! Renee
I am using Zenphoto version 1.4.1.6 [8326] (Official Build)
Current gallery theme: zpFocus_v1.4.1.4
I still have the issue with the /.
The links to my albums on the gallery pages do show the trailing /.
But the links to the albums, pages and news items on my dropdown menu do not display the trailing / in the url.
Each time I add new albums, pages, etc. Google reports that I have more duplicate pages. Hundreds.
I tried modifying the print_album_menu.php as suggested before, but I could not get it to work. Also I tried the code for the htaccess file; it worked for the album links in the menu, but pages and news produced a 404 not found error.
I was wondering if this has changed in the newest release or maybe someone can offer me another solution. I would upgrade, but I don't think my current theme has been updated for the newest Zenphoto upgrade.
I appreciate your time!
Thank-you - Renee
In 1.4.2 RC1 the html_meta_tags plugin has now an option to place a `` type in the ``. Maybe try that out.
Thank-you! Renee