Thirteen Ways To Add SEO To Gallery2

smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Sun, 2007-10-07 02:22

Below are thirteen ways to make Gallery2 search engine optimized. I hope this is a starting point for those that want to make Gallery2 more SEO. I have not seen any centralized location that listed how to add SEO to Gallery2. There are few message threads in the forum that list one or two of these suggestions (and most of these are copied from them), but I have not seen any that list this many in one message or thread. Please remember that the SEO doesn't make you show up higher in search listings, but makes it easier for this to happen. Having other people link to your pages is always the best thing you can do. Any additions to this list would be helpful. If you have questions or would like clarification, please ask.

Some of the suggestions on this list involve editing template and class files, do this at your own risk. Gallery2 administrators recommend copying the file you are editing to the subdirectory called "local" and editing the file there. Gallery2 will then use that file instead of the original. This also means that upgrades will not overwrite your edited file. In the examples below, I am using Gallery 2.2.3.

NOTE: Any new installations should look into the Tags Module I have not used this module, but it appears to have more mature administrative features, such as parent-child relationships, bulk editing, and inline editing while browsing.

--Stephen
http://www.InteractiveLlama.com
Personal Photo Gallery
http://www.LlamaAndLamb.com/photos/

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
THIRTEEN WAYS TO ADD SEO TO GALLERY2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

1. Activate URL Rewrite plugin
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Read through the URL Rewrite Administration page and familiarize yourself with the structure of Gallery2, you'll notice that the permalink of a photo is based on the filename.

2. Make items in keyword and other dynamic albums point to item's permalink
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
All links that can, should point to an item's permalink--after all that is the valuable content--all else is for the user's convenience and experience. This will eliminate some duplicate content and use the keyword album's PageRank to point to the item's permalink.
On the Site Admin page, go to Keyword Album (and/or Dynamic Albums)
Change Thumbnail links in dynamic albums to Jump to original album, and click Global checkbox if possible.

3. Use keywords in filenames
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Since the permalink of an item is based on the filename, the filename of the item affect the keywords contained within the URL. Do not use the file name that a camera gives each photograph, but name your photos using keywords. You can do this manually, or you can use a bulk file renaming tool.

I recommend you use a bulk file renaming tool. On Windows, I use the free Bulk Rename Utility at http://www.bulkrenameutility.co.uk/. It allows all sorts of file naming options including regular expressions, recursive file renaming of files in subdirectories, add suffixes, add prefixes and many, many more. It's a little overwhelming when you first load the program. Thankfully, you can see the actual before/after of the file names, so you don't have to guess at what you are doing. If anyone know of an OS-X bulk renaming tool, please contact me.

My naming convention for a file name is photo_set-photo_subset-people_or_objects. For a photo of my parents, my bride and myself at my wedding, I used wedding-party-rachel-stephen-richard-mary-james.jpg

4. Create keyword-dense titles and keywords for each item
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Having tags or keywords link similar items not only provides users of your site to easily visit similar items, but it also links the keywords with your content for SEO.

Upon wanting to post over five hundred photographs of my honeymoon in Ireland to my Gallery2, I decided to write an automated PHP script that goes through the database and does the following:
Reads in the file name
Replaces the hyphens and/or underscores with spaces
Removes Windows and OS-X renaming suffixes/prefixes such as numerals, parenthesizes and the word "copy."
Then, places this text in the item title field

After creating the title, I re-run the php script that then adds keywords. It does the following:
Reads in the file name
Replaces the hyphens and/or underscores with a comma and a space
Removes Windows and OS-X renaming suffixes/prefixes such as numerals, parenthesizes and the word "copy."
Removes common words such as the, of, to , with, on, through, in and single letters (A-Z)
Then, places this text in the item keyword field

Now you can do all this manually and probably get better results by fine-tuning each item's keywords and title, but in this instance, I did not want to enter thousands of keywords and possibly misspell them. The script has no warranty for anything it does to your system. Before using it, backup your database. After the script has run, the database cache will need to deleted at Site Admin >> Maintenance >> Delete database cache. Visit my media production blog for more information on the Gallery2 titles and keywords search engine optimization script.

5. Optimize robots.txt
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Some say to disallow search engines from listing keyword or tag pages by using disallow within one's robots.txt. The theory behind this is that search engines do not actually stop looking at the pages listed after a disallow command. Disallow is there to prevent good search engines from listing disallowed pages in their search results. They DO read and evaluate disallowed pages for content. So the theory is that when a user searches for a keyword, the keyword page will not show up in the search results, but the actual content pages that the keyword pages link to will show up. This only works with search engines that value linking over keyword density. Since there is usually not much text on an item page, disallowing keyword filled dynamic albums might have negative effects. I suggest you research optimizing your robots.txt more, before disallowing hundreds of pages from search engine results.

6. Remove duplicate information - EXIF and slideshows
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
It helps your search engine listing if you do not have page duplication. EXIF and slideshows will cause duplication and add URL variables to your URL. If you want to check your links for duplicates, send your Gallery2 URL to W3C's Link Validator. Make sure to check "Check linked documents recursively," then read down through the URLs (this will take some time) for URLs with variables in them (e.g.- "?&g2_fromNavId=x1e7341cc&g2_GALLERYSID=d2937").

You will want to prevent duplicate content because of EXIF details mode switching. On each photograph under "Photo Properties," you will see a Summary / Details option. This is almost all duplicate content, and adds variables to your URL. To remove the EXIF mode switching HTML, comment out the following lines in /modules/exif/templates/blocks/ExifInfo.tpl:
LINE 16 - BEFORE

{if isset($block.exif.LoadExifInfo.mode)}
  <div>
    {if ($block.exif.LoadExifInfo.mode == 'summary')}
      {g->text text="summary"}
    {else}
      <a href="{g->url arg1="controller=exif.SwitchDetailMode" arg2="mode=summary" arg3="return=true"}">
	{g->text text="summary"}
      </a>
    {/if}

    {if ($block.exif.LoadExifInfo.mode == 'detailed')}
      {g->text text="details"}
    {else}
      <a href="{g->url arg1="controller=exif.SwitchDetailMode" arg2="mode=detailed" arg3="return=true"}">
	{g->text text="details"}
      </a>
    {/if}
  </div>
  {/if}

LINE 16 - AFTER

{*
{if isset($block.exif.LoadExifInfo.mode)}
  <div>
    {if ($block.exif.LoadExifInfo.mode == 'summary')}
      {g->text text="summary"}
    {else}
      <a href="{g->url arg1="controller=exif.SwitchDetailMode" arg2="mode=summary" arg3="return=true"}">
	{g->text text="summary"}
      </a>
    {/if}

    {if ($block.exif.LoadExifInfo.mode == 'detailed')}
      {g->text text="details"}
    {else}
      <a href="{g->url arg1="controller=exif.SwitchDetailMode" arg2="mode=detailed" arg3="return=true"}">
	{g->text text="details"}
      </a>
    {/if}
  </div>
  {/if}
*}

You can optionally make, the details mode the default with the following:
Edit the default setting for $mode in /modules/exif/SwitchDetailMode.inc
LINE 38 - BEFORE
$mode = 'summary';

LINE 38 - AFTER
$mode = 'detailed';

Next, I would say that this is the least important item on this list, but you want to be sure to remove as much duplicate content as possible, then to remove the slideshow:
Goto Plugins on the Site Admin page.
Deactivate Slideshow and Slideshow Applet

7. Remove multiple sizes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I've never had multiple sizes setup in my Gallery, if someone has the directions on how to deactivate this. It would be helpful.

8. Enable Google Sitemap
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sitemaps are an XML document that lists all content pages. When your site changes, it changes. Just like it says, it is a map. It doesn't automatically get you a higher SEO, it only give the search engine a map to browse your site with. Personally, I'm not convinced that this helps SEO. It just makes sure all your pages get listed--which if you are practicing good SEO on your site, when you should not have to worry about a page not being listed. To enable Google Sitemap:
Goto Plugins on the Site Admin page and deactivate Slideshow and Slideshow Applet
Activate Sitemap

9. Optimize permalinks
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Search engines do not like variables (question marks and ampersands) at the end of URLs. Gallery is made to be sticky with its items which makes human browsing easier and pretty much eliminates the need to use the browser's back button. If you use the breadcrumbs in the upper left to view a parent album, you are shown the album page that contains the item you were just viewing. Below are changes to make to the Gallery2 code

Comment out the urlParams call in /modules/core/classes/GalleryTheme.class
LINE 1408 - BEFORE

if (!empty($theme['parents'][$i + 1]['id'])) {
	$urlParams['highlightId'] = $theme['parents'][$i + 1]['id'];
} else if ($itemId && ($i + 1) == count($theme['parents'])) {
	$urlParams['highlightId'] = $itemId;
}

LINE 1408 - AFTER

/* if (!empty($theme['parents'][$i + 1]['id'])) {
	$urlParams['highlightId'] = $theme['parents'][$i + 1]['id'];
} else if ($itemId && ($i + 1) == count($theme['parents'])) {
	$urlParams['highlightId'] = $itemId;
} */

Remove arg3 in /modules/keyalbum/templates/blocks/KeywordLinks.tpl
LINE 15 - BEFORE

  {foreach from=$block.keyalbum.keywords item=keyword}
    <a href="{g->url arg1="view=keyalbum.KeywordAlbum" arg2="keyword=$keyword"
		     arg3="highlightId=`$item.id`"}">{$keyword}</a>
  {/foreach}

LINE 15 - AFTER

  {foreach from=$block.keyalbum.keywords item=keyword}
    <a rel="tag" href="{g->url arg1="view=keyalbum.KeywordAlbum" arg2="keyword=$keyword"
		     }">{$keyword}</a>
  {/foreach}

NOTE: I have also added rel="tag" which is a microformat for tags and keywords. I know that Technorati and WordPress utilize this markup.

10. Make item titles into heading text and links
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Add heading tags to item tites in /themes/matrix/templates/album.tpl (with "matrix" being your current theme)

LINE 121 - BEFORE

		<p class="giTitle">
		  {if $child.canContainChildren && (!isset($theme.params.albumFrame)
		   || $theme.params.albumFrame == $theme.params.itemFrame)}
		    {* Add prefix for albums unless imageframe will differentiate *}
		    {g->text text="Album: %s" arg1=$child.title|markup}
		  {else}
		    {$child.title|markup}
		  {/if}
		</p>

LINE 121 - AFTER

		<h2 class="giTitle">
		  {if $child.canContainChildren && (!isset($theme.params.albumFrame)
		   || $theme.params.albumFrame == $theme.params.itemFrame)}
		    {* Add prefix for albums unless imageframe will differentiate *}
		    <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
		    {g->text text="Album: %s" arg1=$child.title|markup}</a>
		  {else}
		  <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
		    {$child.title|markup}</a>
		  {/if}
		</h2>

11. Prevent duplicate base URLs for your Gallery
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
On Apache servers, you can change by each directory how the web server serves up your pages within a file named .htaccess. If you have implimented the URL Rewrite plugin correctly, then you should already have an .htaccess file in your Gallery2 directory. Redirects affect SEO negatively, and it has been said that two site homepages, /main.php and /, harm SEO. To prevent the 301 redirect to /main.php, add the following lines to the top of your .htaccess:

# Set the default handler.
DirectoryIndex main.php

It should be said that not all hosts allow you do change the DirectoryIndex. Also, this also might need to be done to get rid of "main.php" in the breadcrumb. I'm not sure if I changed this myself or gallery set it automatically, but on line 177 of /config.php, I have:

$gallery->setConfig('baseUri', 'www.mydomain.com/photos/');

In a related note, some search engines will differentiate www.yourdomain.com and yourdomain.com. This not good and could result in duplicate content. You can search Google via site:yourdomain.com and find out how your site is currently listed. You want to be listed in the same format that external links and internal links are linking to your site. To redirect pages without "www" to a page with the prefix, add the following lines to the top of your .htaccess:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

If you are hosting, your Gallery2 in a subdirectory (e.g.- photos), use this:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/photos/$1 [R=301,L]

12. Add META tags to your Gallery2 pages
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
It has been said that META tags have lost importance since their glory days ten years ago. They have lost importance to external links, but they are not to be disregarded. To add the META tags keyword and description to your Gallery2 pages add the following lines to /themes/matrix/templates/theme.tpl (with "matrix" being your current theme).

LINE 19 - BEFORE

	{* If Gallery doesn't provide a header, we use the album/photo title (or filename) *}
	{if empty($head.title)}
	<title>{$theme.item.title|markup:strip|default:$theme.item.pathComponent}</title>
	{/if}

LINE 19 - AFTER

	{* If Gallery doesn't provide a header, we use the album/photo title (or filename) *}
	{if empty($head.title)}
	<title>{$theme.item.title|markup:strip|default:$theme.item.pathComponent}</title>
	{/if}
	<meta name="keywords" content="{$theme.item.keywords|markup:strip|default:$theme.item.pathComponent}" />
	<meta name="description" content="{$theme.item.description|markup:strip|default:$theme.item.pathComponent}" />

Note: The above is only an addition of the meta tags.

13. Optimize page title
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Page titles are some of the most important information used for SEO. Search engines will only use the first so many characters. I've heard that title elements should ideally be less than 64 characters in length. That doesn't been you can't use longer ones though. Forum user, maravizzo, suggests adding the title of the parent album to the page title. This should increases your associated keyword density in your page title.

Add lines in /themes/matrix/templates/theme.tpl
LINE 14 - BEFORE

{if empty($head.title)}
<title>{$theme.item.title|markup:strip|default:$theme.item.pathComponent}</title>
{/if}

LINE 14 - AFTER

{if empty($head.title)}
     <title>{$theme.item.title|markup:strip|default:$theme.item.pathComponent}
     {if $theme.parent.title}
          :: {$theme.parent.title|markup:strip|default:$theme.parent.pathComponent}
      {/if}
:: Title of Site</title>
    {/if}

14. Create SEO page numbers
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is related to number six, Optimize permalinks, but I have yet figured how to do it. I've read URL Rewrite for page number at http://gallery.menalto.com/node/49021 but did not want to change my current item permalinks. If anyone has suggestions, I'd love to see this addressed.

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Fri, 2007-10-12 15:24

Very timely info. Thank you so much for adding this!

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Wed, 2007-10-17 00:34

great thread!

when you talk seo for photo gallery software, you have to think about the gallery2 image alt text... one of the few threads that i've seen on the subject is this one: http://gallery.menalto.com/node/62170

i can't get the code in that thread to work, i wish that it was a documented a little better.

afaik, with the default g2 install, the only alt text is the name of the jpg.

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Wed, 2007-10-17 01:09

@osv

My alt text is the title of the item. I usually think of descriptions as being a few sentences. Do you think it's a good idea to link multiple sentences with one link? It might degrade the quality of the keywords.

Also, are you proposing the alt text be the description on the item's permalink page or in the navigation (in it's parent album)? If you are referring to the item's page, then you'll be duplicating the same content on the same page. I think it would make the most sense to include the item's description in the navigation (in it's parent album), especially if similar keywords were mentioned across multiple items in an album.

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.smjdesign.com/photos/

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Wed, 2007-10-17 03:14

any way that you do it there will be duplication, but i think that you are right about the length of the descriptions being a bit much for alt text... the album keywords could be an issue as well... would you be willing to share how you made the title of the item the alt text? that may be the best solution.

one important factor in google image search ranking is the proximity of the text to the image.

i'm brand new to g2, so i'm not up on where the permalink falls in the equation, although i have read speculation that it has the potential to create a duplicate content situation?

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Wed, 2007-10-17 04:06

@osv

I have not customized my Gallery2 to have titles as the alt text. I believe it is the default. The default title however is the name of the file, so I'm guessing that you haven't added your own title to each image and have let Gallery make the filename into the title.

That's a good point about the proximity to the image. When I usually think about SEO, I don't think about image search or wanting to show up high in image search. I tend to think about the main search.

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.smjdesign.com/photos/

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Wed, 2007-11-07 03:25

i don't know what the default titles are, because i always put in custom titles for every image(aka every image page)... what i'm seeing is the name of the pic being the same as the alt text for the pic... sounds like we are looking at different pages?

EDIT: turns out that there are a couple of choices for where the default titles come from, but i can't remember where those choices are located in the gallery software.

for image search feasibility, you have to evaluate the sector you are in... most of the time there are more search results returned in the regular google search, so it will be harder to rank there... look for the gallery2 site andrewprokos.com, search term "new york photos":

google search: front page, out of 50 million results, outstanding!
google image search: no pics in the first few pages(74 million results), not good.

if you look at andrewprokos.com, the seo is good for google search, but really weak for google image search, because he doesn't have any photo names per se, nothing that says "jpg"... on a side note, you should also open up the directory the photos are in for public browsing, the search engines can find the content easier.

i'm desperately trying to figure out how he mapped out his site structure, because there is no "gallery2" or "index.php/main.php" in his page titles... getting rid of the g2 garbage is another aspect of seo that could be covered in this thread.

EDIT EDIT: great, the forum software bumped this post out of sequence when i edited it :-/

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Wed, 2007-10-17 19:25

@osv

Getting rid of the index.php/main.php is this number

11. Prevent duplicate base URLs for your Gallery
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
On Apache servers, you can change by each directory how the web server serves up your pages within a file named .htaccess. If you have implimented the URL Rewrite plugin correctly, then you should already have an .htaccess file in your Gallery2 directory. Redirects affect SEO negatively, and it has been said that two site homepages, /main.php and /, harm SEO. To prevent the 301 redirect to /main.php, add the following lines to the top of your .htaccess:

# Set the default handler.
DirectoryIndex main.php

getting rid of the g2 garbage is this number

9. Optimize permalinks
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Search engines do not like variables (question marks and ampersands) at the end of URLs. Gallery is made to be sticky with its items which makes human browsing easier and pretty much eliminates the need to use the browser's back button. If you use the breadcrumbs in the upper left to view a parent album, you are shown the album page that contains the item you were just viewing. Below are changes to make to the Gallery2 code

Comment out the urlParams call in /modules/core/classes/GalleryTheme.class

Aren't these what you are referring to? That's the way it is on my site. Home is http://www.smjdesign.com/photos/ not http://www.smjdesign.com/photos/main.php

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.smjdesign.com/photos/

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Thu, 2007-10-18 06:40

thanks smj, i already had the default handler set, but per your post for #11, i was able to remove main.php from the breadcrumb:
$gallery->setConfig('baseUri', 'www.mydomain.com/photos/');
so now i have:
actual link in browser window: mysite.com/gallery2/main.php
breadcrumb highlight link: mysite.com/gallery2/

still working on the term "urlParams" in that file.

i guess that this has to be spelled out exactly for the dummies like me who can't write code :-/

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Thu, 2007-10-18 13:24

It is possible that you hosts doesn't allow you to change the DirectoryIndex. Also, the order of htaccess is very important and the DirectoryIndex directive should be at the top.

--Stephen

 
francisca

Joined: 2005-10-29
Posts: 14
Posted: Thu, 2007-10-18 19:22

This tutorial is quite excellent.

Question... as you state the permalink points to a 'filename', are there examples of this anywhere? I have been searching and searching for it suse, examples, anything, but can't find.

Am trying to learn how to point to an image, object, entity, filename, whatever... using this /f/ function. Or is this not the correct use? From what I have read, G2 should do this. Help???

.................................

3. Use keywords in filenames
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Since the permalink of an item is based on the filename, the filename of the item affect the keywords contained within the URL. Do not use the file name that a camera gives each photograph, but name your photos using keywords. You can do this manually, or you can use a bulk file renaming tool.

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Thu, 2007-10-18 20:02

@francisca

I don't know the use of the the permalink module's "/f/%filename%.JPG", but I know that you can change the URL of a filename ("/v/%album%/%filename%.JPG") by changing the name (not the title) in "Edit Photo"

--Stephen

 
francisca

Joined: 2005-10-29
Posts: 14
Posted: Thu, 2007-10-18 21:01

Ah, thank you for your response. Yes, I have done as you indicated for this kind of 'access' to the image. That works.

What I am trying to find ut is how the /f/ behaves. For the life of me have not been able to locate examples of this... yes it is sitting smack in the middle of the Site Admin/URL Rewrite panel.

Thank you for this very fast resposne.

f

smjdesign wrote:
@francisca

I don't know the use of the the permalink module's "/f/%filename%.JPG", but I know that you can change the URL of a filename ("/v/%album%/%filename%.JPG") by changing the name (not the title) in "Edit Photo"

--Stephen

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Thu, 2007-10-18 21:45

fwiw, you can replace the "f" or the "v" or any of those letters with a word, or another letter... just don't use the replacement item in more than one place.

i have my own dedicated windows server, and since it doesn't have native url rewriting capability, i have to use something like the helicon ISAPI_Rewrite 2.x module... that version of the module is old, it's a proprietary format, and it does not recognize the standard apache rewrite text, for instance a non-www to www rewrite(step #11 above)is:
RewriteCond Host: mysite\.com
RewriteRule (.*) http\://www.mysite.com$1 [I,RP]

it can only utilize httpd.ini, not .htaccess, so things that were created for .htaccess have to go in the httpd.ini, and i don't know if they are in the proper vernacular to begin with, for instance is this helicon 2.x-compatible:
# Set the default handler.
DirectoryIndex main.php

long story short, doing this seo on a windows server is a nightmare... i've re-installed gallery2 from scratch multiple times, and i can't get rid of those stupid highlights in the breadcrumbs, even after deleting the urlParams in gallerytheme.class... so ymmv with windows.

 
francisca

Joined: 2005-10-29
Posts: 14
Posted: Thu, 2007-10-18 23:39

Thank you for your response. Yes, I have played with changing the 'v' to other characters and strings. This is going to sound moronic, but what does the /f/%filename% actually call, or do? What 'filename' does it run?

I am trying to learn how to have it call an image name, item name, object name. Like permalinks work for albums, I'd like to figure out to have each image, preferably a sized version, reachable the same way via a permalink call.

Thoughts? Really appreciate your response to this.

osv wrote:
fwiw, you can replace the "f" or the "v" or any of those letters with a word, or another letter... just don't use the replacement item in more than one place.

i have my own dedicated windows server, and since it doesn't have native url rewriting capability, i have to use something like the helicon ISAPI_Rewrite 2.x module... that version of the module is old, it's a proprietary format, and it does not recognize the standard apache rewrite text, for instance a non-www to www rewrite(step #11 above)is:
RewriteCond Host: mysite\.com
RewriteRule (.*) http\://www.mysite.com$1 [I,RP]

it can only utilize httpd.ini, not .htaccess, so things that were created for .htaccess have to go in the httpd.ini, and i don't know if they are in the proper vernacular to begin with, for instance is this helicon 2.x-compatible:
# Set the default handler.
DirectoryIndex main.php

long story short, doing this seo on a windows server is a nightmare... i've re-installed gallery2 from scratch multiple times, and i can't get rid of those stupid highlights in the breadcrumbs, even after deleting the urlParams in gallerytheme.class... so ymmv with windows.

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Fri, 2007-10-19 06:38

having spent the last week pouring over this forum, my uneducated impression is that those weird /f/%-type letters were created in order to obtain the fastest possible operation of the database... they don't serve any useful seo or organizational purpose that i can figure out.

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Thu, 2007-11-01 13:36

Excellent thread and some really good ideas.

The ALT tags for images is a MUST. Google is really big on these. Be as descriptive as you can within reason (DO NOT SPAM THE TAGS). Also, adding the meta description and keywords can help some too. Although Google does not use the meta keywords to index your site, it does use the description somewhat. It will highlight words in the description that match your query.

Live/MSN still use meta keywords.

Again, thanks for the tips. There's a lot of good stuff there that most of us wouldn't have thought about.

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Wed, 2007-11-07 03:29

big problem with duplicate content in the google search engine... it seems that there are two copies of all my gallery pages, the dupes have "?g2_jsWarning=true" in the link... this is a disaster.

has anyone seen this before? here are the search results, they will be gone shortly because i deleted the links with google webmaster tools: http://www.google.com/search?q=site:dragracingtv.com&hl=en&start=100&sa=N

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Wed, 2007-11-07 03:41

@osv

I'm guessing its your Javascript sidebar. That's the only Javascript on your screen. This is in your actual HTML: <div class="gbBlock giWarning">
JavaScript must be enabled for this page to function properly. However, it seems JavaScript is either disabled or not supported by your browser. Please enable JavaScript by changing your browser options, then try again.
</div>

--Stephen

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Wed, 2007-11-07 11:02

Stephen is correct. Its your sidebar. Put your mouse over the link on one of those pages for the sidebar.

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Wed, 2007-11-07 15:17

thank you both very much, i'm running the carbon theme... so googlebot can't parse the js correctly? i'll ask this question over on the theme forum.

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Wed, 2007-11-07 15:41
osv wrote:
thank you both very much, i'm running the carbon theme... so googlebot can't parse the js correctly? i'll ask this question over on the theme forum.

No. Spiders (not just Google) do not process JavaScript.

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Thu, 2007-11-08 01:38

it was pointed out to me that i have not just the dhtml sidebar, but also a second dhtml menu, on the same page... dhtml uses javascript.

i have been able to confirm that this dupe content is an issue with the carbon theme, at the minimum... here are two pages from the creator of the carbon theme, mincel... notice how both are ranked in the google search engine:
http://www.google.com/search?hl=en&q=www.mincel.com%2Fgallery%2Fbornean%2Borangutan&btnG=Search
click on "repeat the search with the omitted results included."

cutting to the chase, i guess that i have two options:
1) get rid of the dhtml menus
2) figure out how to exclude the "g2_jsWarning=true" in the robots.txt, but not all search engines respect robots.txt.

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Thu, 2007-11-08 01:51

pursuant to the above :-/ here is how to delete dupe content pages in the search engines... as an aside, you might also want to consider using a 301 redirect, if there are links or google pr pointing to the dupe pages.

so far just google and yahoo allow you to do this, what you have to do is authenticate your sites with them, by uploading some code so that they can see it.

you can do a search for all of your pages in the search engines: site:mysite.com, or site:www.mysite.com

https://www.google.com/webmasters/tools/docs/en/about.html
https://siteexplorer.search.yahoo.com

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Thu, 2007-11-08 12:29

All the good engines use robots.txt. Google, Yahoo, Ask, MSN/Live. Outside of those, who cares. They power most of the other engines out there.

Currently only Google & Yahoo offer anything for webmasters to maintain sitemaps and other information. Hopefully MSN/Live will jump on board with something. If you don't have your FREE account setup with these two, you have been missing out. Google has some of the best free tools.

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Thu, 2007-11-08 19:42

they will all read the robots.txt, but they don't all interpret it the same way... for instance, some search engines don't allow wildcards at all(per the original robots.txt standard), while others process wildcard commands differently.

in this case, i don't want any url with a "?" in it, which google fortunately has a wildcard command for:
To block Googlebot from block crawling any URL that includes a ? (more specifically, any URL that begins with your domain name, followed by any string, followed by a question mark, followed by any string):

User-agent: Googlebot
Disallow: /*?
http://www.google.com/support/webmasters/bin/answer.py?answer=35303

i believe that the yahoo version is the same syntax?:
http://www.ysearchblog.com/archives/000372.html

here is my robots.txt, substitute "gallery2" for "media", if you have the standard g2 install... and as smj mentioned in step 5 above, be careful with this:
User-agent: *
Disallow: /media/main.php?g2_view=core.UserAdmin*
Disallow: /media/main.php?g2_view=comment*
Disallow: /media/c/*
Disallow: /media/key/*
Disallow: /media/popular?*g2_page*
Disallow: /media/updates?*g2_page*
Disallow: /media/index.php?*g2_rating*
Disallow: /media/admin*
Disallow: /media/srss/
Disallow: /media/rss
Disallow: /media/*?

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Thu, 2007-11-08 19:58
osv wrote:
they will all read the robots.txt, but they don't all interpret it the same way... for instance, some search engines don't allow wildcards at all(per the original robots.txt standard), while others process wildcard commands differently.

That's not true with the major search players. Google, MSN/Live.com, Yahoo and Ask all support wildcards in the robots.txt. Note that most of them point you to http://www.robotstxt.org/ for more information.

Google
http://www.google.com/support/webmasters/bin/answer.py?answer=40367

Yahoo
http://help.yahoo.com/l/us/yahoo/search/webcrawler/slurp-02.html

MSN/Live.com
http://search.msn.com.sg/docs/siteowner.aspx?t=SEARCH_WEBMASTER_REF_GuidelinesforOptimizingSite.htm

ASK
http://about.ask.com/en/docs/about/webmasters.shtml#7

One thing that needs to be considered when using a robots.txt is that most search engines PREFER that you specify the user agent rather than using the *.

User Agents:
Google - Googlebot
Yahoo - Slurp
MSN/Live.com - MSNBot
Ask - Teoma

All that said, I'll reiterate this point. These are the major engines and the providers of search data to MANY others. These are the guys to optimize for.

And just for kicks, here's Google's robots.txt:
http://www.google.com/robots.txt

...I love threads like this. :-)

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Thu, 2007-11-08 22:02
Addict wrote:
Google, MSN/Live.com, Yahoo and Ask all support wildcards in the robots.txt. Note that most of them point you to http://www.robotstxt.org/ for more information.

that is not correct, both msn/live and ask do not officially support wildcards, which is why i did not list them :-) there is no wildcard spec in their robots.txt urls that you listed, because again, wildcards have never been part of the original robots.txt specifications.

if you test the robots.txt that i posted here on any validator, it will fail, because it's not legal to the original robots.txt standards... but it will pass 100% on the google robots.txt validator.

putting user agents in front of wildcard commands might be a good idea, but the only thing that i care about is google, yahoo, and msn/live, and if the latter won't agree with what the first two already agree on, well, i can live with that :-)

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Fri, 2007-11-09 01:59
osv wrote:
that is not correct, both msn/live and ask do not officially support wildcards, which is why i did not list them :-) there is no wildcard spec in their robots.txt urls that you listed, because again, wildcards have never been part of the original robots.txt specifications.

You are correct about MSN/Live.com. They are still a good ways behind the others. They don't even support sitemaps yet (as far as I know). Pretty lame.

Quote:
putting user agents in front of wildcard commands might be a good idea, but the only thing that i care about is google, yahoo, and msn/live, and if the latter won't agree with what the first two already agree on, well, i can live with that :-)

True. True. Yahoo & Google support the addition of SITEMAP: in the robots.txt now. Not sure what the others will do when they hit that.

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
maravizzo
maravizzo's picture

Joined: 2005-09-11
Posts: 49
Posted: Sun, 2007-11-11 08:06

Someone in another post suggests to add in the TITLE tag not only the item title, but also the parent item title (if any).
I think is a good idea because subalbums are usually part of the parent one: so they can get useful and very relevant keywords in the title.
Here is the code I put on my template.
In theme.tpl find the line:

<title>{$theme.item.title|markup:strip|default:$theme.item.pathComponent}</title>

And modify it in this way:

<title>{$theme.item.title|markup:strip|default:$theme.item.pathComponent}
{if $theme.parent.title}
 - {$theme.parent.title|markup:strip|default:$theme.parent.pathComponent}
{/if}
</title>

Matteo

------------------------------------------
My Gallery sites:
http://www.ruraljourney.com/italy_travelguide/
http://www.zorring.org/

 
maravizzo
maravizzo's picture

Joined: 2005-09-11
Posts: 49
Posted: Sun, 2007-11-11 16:48

Hi again!

I need some help to get rid of main.php on my gallery at www.zorring.org...
The problem is that my host support URL REWRITE, but does not support: DirectoryIndex main.php!
Does anybody know if there is a way to rewrite the url "/main.php" to "/" ?

Thank you

------------------------------------------
My Gallery sites:
http://www.ruraljourney.com/italy_travelguide/
http://www.zorring.org/

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Mon, 2007-11-12 15:29

Does anyone think there could be SEO issues with having our URLS like: jpg.html ? I seem to see some rumblings about this over at webmasterworld as how it may cause conflicts with Google Images or even the vanilla Google search. Can anyone confirm that their "jpg.html" URLs are indeed being correctly indexed? Thanks.

 
osv

Joined: 2007-09-19
Posts: 26
Posted: Mon, 2007-11-12 19:45

maravizzo: http://www.google.com/search?hl=en&q=main.php+site%3Awww.ruraljourney.com does not show the main.php on any urls? did i do the search correctly?

i'm confused about the tip you gave, i need to figure that one out, thanks

skunker, i can confirm that jpg.html will index the web page url correctly in google search, but google image search is another question... it's very flakey, it doesn't update often, but i'm hoping that the pics will show up there.

 
bollywoodguru
bollywoodguru's picture

Joined: 2007-11-26
Posts: 4
Posted: Tue, 2007-11-27 12:22

this is really good !! bookmarked for futher use.

 
maravizzo
maravizzo's picture

Joined: 2005-09-11
Posts: 49
Posted: Fri, 2007-12-07 09:28

Hi back after a long while!

For Osv: I didn't have problem with www.ruraljourney.com, that host service is ok and support DirectoryIndex, but the zorring.org host doesn't!
Anyway, I've solved that to, with a sort of inelegant hacking: there is a way to replace index.php with main.php, but then, if you Gallery is in the domain root you have to fight with a problem with url rewrite.
If some one need it I can tell my inelegant solution...

Now a question:
What do you think about the TAGS module ( http://codex.gallery2.org/Gallery2:Modules:tags ) and SEO?
Tags cloud and similar staff can be an improvement or not?

Bye

------------------------------------------
My Gallery sites:
http://www.ruraljourney.com/italy_travelguide/
http://www.zorring.org/

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Fri, 2007-12-07 12:50

@maravizzo:
I have never used the tags module, but it looks like an administrative improvement on the same functionality of the keywords. It appears bulk editing and parent-child relationships are more mature then keywords. I should investigate this module and add it to the my list above, although I will probably not do this anytime soon, since keywords appear to have same functionality.

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.smjdesign.com/photos/

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Fri, 2007-12-07 17:16

I use the tags module. Its pretty nice. I haven't seen any increase since I've been using it (or any decrease). It DOES get indexed very well. My gallery PR has been a steady 5 and that hasn't changed since using tags.

Always worth a shot.

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
maravizzo
maravizzo's picture

Joined: 2005-09-11
Posts: 49
Posted: Sat, 2007-12-08 08:02

Ok, thanks, I'll test it too!

Bye

------------------------------------------
My Gallery sites:
http://www.ruraljourney.com/italy_travelguide/
http://www.zorring.org/

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Wed, 2007-12-12 01:21

Have you submitted any of these code so they will become (optional?) standard features of the matrix theme?

I like the change to the page titles, and ideally I don't want to have to redo these.

btw it looks like the page numbers in the rewrite module has been partially implemented - I can't get it to work on dynamic albums... but other than that works great.

 
micrafty

Joined: 2007-12-27
Posts: 53
Posted: Wed, 2008-01-02 01:40

Wow, thank you for this list. It's the first place anyone with a new install should come.

I do have a question about alt descriptions for the images. Gallery2 appears to be grabbing the description and using it for longdesc - how do I make it stop? I try to use several sentences for my descriptions and I would think such a long longdesc could be considered keyword stuffing.

I'm using 2.2.4.

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Mon, 2009-01-12 03:17

@ micrafty

Are you wanting to disable the ALT attribute in all you images, so that the same description doesn't appear twice?

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.LlamaAndLamb.com/photos/

 
micrafty

Joined: 2007-12-27
Posts: 53
Posted: Thu, 2008-01-03 23:45

Here's an example of what I'm getting:

Quote:
<img src="/d/53-2/ivy.jpg" width="94" height="150" id="IFid2" class="ImageFrame_image giThumbnail" alt="Ivy" longdesc="One in a series of Victorian era images of girls and flowers. Little Ivy with her dark hair and green dress is just waiting to become part of your latest art project. This downloadable image is the perfect size to use for notecards and postcards."/>

It appears that the alt=title and the longdesc=description. Even if I could just change it to the longdesc=summary, it would be better. I think the easiest thing to do would be to not use a longdesc at all. How/where would I delete that part?

If I were programming it from scratch (not likely with my skills), I would love for the alt=summary and there to be no longdesc.

And here's my site info:

Quote:
Gallery version = 2.2.4 core 1.2.0.6
PHP version = 4.4.7 cgi
Webserver = Apache Webserver
Database = mysqlt 5.0.27-standard, lock.system=flock
Toolkits = Exif, Gd
Acceleration = none, none
Operating system = Linux adhara.lunarpages.com 2.6.9-55.0.9.ELsmp #1 SMP Thu Sep 27 18:27:41 EDT 2007 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Rows in GalleryAccessMap table = 57
Rows in GalleryAccessSubscriberMap table = 65
Rows in GalleryUser table = 2
Rows in GalleryItem table = 65
Rows in GalleryAlbumItem table = 25
Rows in GalleryCacheMap table = 0

 
maravizzo
maravizzo's picture

Joined: 2005-09-11
Posts: 49
Posted: Sat, 2008-01-12 11:51

Hi micrafty,

I have very long description form my albums on http://www.ruraljourney.com/italy_travelguide/ , so replacing Description with Summary in longdesc is exactly what I've done.
Unfortunately the setting is not in a template file, but is hard coded in a class file.

Edit:
modules/core/classes/GalleryDerivativeImage.class

On line 210 (Gallery version 2.2.4) you should find the following function. Replace getDescription with getSummary in this way:

	    if (!isset($params['longdesc'])) {
		$longdesc = preg_replace('/[\r\n]+/', ' ',
			GalleryUtilities::markup($item->getSummary(), 'strip'));
		if (!empty($longdesc)) {
		    $params['longdesc'] = $longdesc;
		}
	    }

Editing a class file can't be done in a "local" folder as a template, so you have to check every Gallery update if the new version has overwritten it.
Actually if the updater warns you that one file of the gallery installation has something wrong... then everything is still ok :-)
While if the updater shows only green "OK", then you have to edit it again...

Bye bye
Matteo

------------------------------------------
My Gallery sites:
http://www.ruraljourney.com/italy_travelguide/
http://www.zorring.org/

 
micrafty

Joined: 2007-12-27
Posts: 53
Posted: Sat, 2008-01-12 16:24

Thank you Matteo. I found another thread yesterday that talks about removing the longdesc completely. What I ended up doing was implementing the removal suggestion and making the alt=item summary. The code follows if anyone else is interested...

Quote:
if (!isset($params['alt'])) {
$params['alt'] =
$item->getTitle() ? GalleryUtilities::markup($item->getSummary(), 'strip')
: $item->getPathComponent();
}
if (!isset($params['longdesc'])) {
$longdesc = preg_replace('/[\r\n]+/', ' ',
GalleryUtilities::markup($item->getDescription(), 'strip'));
if (!empty($longdesc)) {
$params['longdesc'] = $longdesc;
}
}

// Violently remove longdesc
unset ($params['longdesc']);

Also, according to the other thread another file has to also be changed - modules/core/classes/GalleryPhotoItem.class

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2008-01-12 23:04

Fixed in this revision: http://gallery.svn.sourceforge.net/viewvc/gallery?view=rev&revision=16885

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Addict

Joined: 2003-07-23
Posts: 27
Posted: Thu, 2008-01-17 16:05

Excellent. :)

______________________________________________
Digital Deviation - http://digitaldeviation.com

 
jens_k

Joined: 2007-01-28
Posts: 244
Posted: Sat, 2008-01-19 16:00

1) After the upgrade to v2.2.4 one of my changes regarding to SEO does not work anymore:

For optimizing the links to the pages and eliminating the /updates/?g2_page=2 in the URI I have added the keyword page in /modules/dynamicalbum/modules.inc

    /**
     * @see GalleryModule::getRewriteRules
     */
	 /* -- JK -- SEO optimizing whole func */
    function getRewriteRules() {
	return array(
		array('comment' => $this->translate('Updates Album'),
		      'match' => array('view' => 'dynamicalbum.UpdatesAlbum'),
		      'pattern' => 'updates/%page%',
		      'help' => $this->translate('Short URL for album of recent items'),
			  'page' => array('pattern' => '([0-9]*)',
			  'help' => $this->translate('Page number in a dynamic album'))),
		array('comment' => $this->translate('Popular Album'),
		      'match' => array('view' => 'dynamicalbum.PopularAlbum'),
		      'pattern' => 'popular/%page%',
		      'help' => $this->translate('Short URL for album of most viewed items'),
			  'page' => array('pattern' => '([0-9]*)',
			  'help' => $this->translate('Page number in a dynamic album'))),
		array('comment' => $this->translate('Random Album'),
		      'match' => array('view' => 'dynamicalbum.RandomAlbum'),
		      'pattern' => 'random/%page%',
		      'help' => $this->translate('Short URL for album of random items'),
			  'page' => array('pattern' => '([0-9]*)',
			  'help' => $this->translate('Page number in a dynamic album'))),
		);
	 }

As the file was not changed by updating the code is still existing. In the SiteAdmin I can not see the additional keyword %page% for the dynamic albums. For my keyalbums this modification still works fine.

What can I change in the current version 2.2.4 to implement this SE optimization?

2) At the Navigation on album pages there are still differences between using the Previous/First icon and the directly linked Pages (Page 1 2 3...).
If you are on any other page than the the first one you will have the following situation by going to the first album page:
- using the Previous/First icons you will be linked to .../album/
- using the Page 1 link you will be linked to .../album/1
So there is duplicated content for the search engines, as the first page of every album is reached via this to URI's.

Is there a way to eliminate the /1 from the navigation for the first page of every album?

Thanks for your support,
Jens

Gallery version = 2.2.4 core 1.2.0.6
PHP version = 4.4.7 apache2handler
Webserver = Apache
Database = mysqlt 4.1.22-max-log, lock.system=flock
Toolkits = Gd, Thumbnail, Exif, LinkItemToolkit
Acceleration = none/86400, none/3600
Operating system = Linux dd18734 2.6.17.8-nmm1 #4 SMP Fri Jan 26 15:05:12 CET 2007 i686
Default theme = x_treme
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.11) Gecko/20071127 ImageShackToolbar/4.3.5 Firefox/2.0.0.11
Rows in GalleryAccessMap table = 38
Rows in GalleryAccessSubscriberMap table = 554
Rows in GalleryUser table = 11
Rows in GalleryItem table = 549
Rows in GalleryAlbumItem table = 39
Rows in GalleryCacheMap table = 0

If you want to have a look you can find this gallery at
jekophoto[dot]eu[slash]gal2.
Sorry for not writing as Link, I do not want to publish the new URI to search engines at this time...
__________________
http://jekophoto.de

 
micrafty

Joined: 2007-12-27
Posts: 53
Posted: Mon, 2008-01-21 20:40

Jens, I tried on a new install of 2.2.4 to make that modification and it ended up creating a giant mess. Never did get an answer to what caused the site to break nor a solution to fix it. (There's a thread someplace that I started relating to it.) I'm not happy with leaving it as the default settings, but at least my site is working.

 
oriolhernan

Joined: 2008-01-08
Posts: 41
Posted: Thu, 2008-01-24 02:00

I followed the instructions to improve SEO but I have a problem with it. When I edit a description i can't put html links or any other type of format, only text. It's related that when I edit the description, i save, and then the texts is visualizated in correct form but when I enter again at edit album there's no description in the texts square.

The important thing is to recover the use of the format tools at description.

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Wed, 2008-04-23 22:20

I've been noticing lots of SESSION IDS appended to my URLS. Does anyone know why it does this and how I can get rid of this? Thanks.

 
EverythingEverywhere
EverythingEverywhere's picture

Joined: 2008-04-25
Posts: 3
Posted: Fri, 2008-04-25 10:40

I just installed Gallery2 and imported 2,800 photos from Flickr. The importing script worked great, but the file and folder names are gibberish. Are there any bulk renaming tools I can use which will rename files based on the titles?