Gallery2 – removing "302 redirects".

I noticed that our [Gallery2](http://gallery.ibao.net) webpage has been ignored by Google Images. I researched this topic a bit and found the [list of search engine optimization tips for Gallery](http://gallery.menalto.com/node/36854), among which there was a line about avoiding “302 redirects”.

As it turns out Gallery uses a “302 redirect” to load “main.php“ on the initial load and it is also redirected from “index.php“, which is claimed to incur some anti-spam penalties for the Google engine. I don’t know whether this is true or not, but to be on the safe side, I decided to remove the reidirects.

Here’s what I did:

1. Move my site-specific “index.php“ somewhere else.
2. “ln -s main.php index.php“
3. Add the following line in the site-specific “config.php“:

define(‘GALLERY_MAIN_PHP’, ‘index.php’);

Everything seems to work now. We will see in a couple of weeks how well it works for the search engines ;-)

4 Responses to “Gallery2 – removing "302 redirects".”

  1. bharat Says:

    If you upgrade to Gallery 2.1, you can use the sitemap module, which will generate a Google sitemap for your Gallery that you can submit to Google. This will provide Google with a complete map to your Gallery install and let it spider your photos much more efficiently.

  2. william quartz Says:

    Some of these 302 redirects are merely tracking URLS and are not a deliberate attempt to hijack your web page so please read all of the following before taking action.

  3. Ilya V. Azarov Says:

    Thanks for the simple solution, that was a problem to give people direct links to my galleries.

    Thank a lot :)

    Now I’m playing around stupid wpg2 plugin to remove such stupid redirects out from there.

  4. Brainstorm weblog » Решение проблемы “тупых” редиректов в Gallery2 Says:

    [...] довольно просто. Решение очень простое – читаем по ссылке или в английской версии данного [...]

Leave a Reply