[SOLVED] Image locations have changed

TimmyRaa

Joined: 2005-03-22
Posts: 3
Posted: Tue, 2005-03-22 21:52

I've upgraded my Gallery 1.5 installation to the G2 Dark Fibre release, and have imported all my old albums across. As I have a lot of images still linked to on various messageboards I installed G2 over my existing Gallery install at /gallery rather than /gallery2 that the install suggests.

However, I've found that the location of the images/albums on my site has changed:

Before: http://www.timspence.co.uk/gallery/albums/PhotoshopWork/
After: http://www.timspence.co.uk/gallery/v/albums/PhotoshopWork/

See the addition of the V? Why is this, and can it be changed as it's causing every image I've ever linked to to not work. I suspect I might be able to work around it with mod_rewrite in the .htaccess file, but I've no idea how to!

Thanks, and keep up the great work - it's a fantastic product!

----

Gallery URL (optional): http://www.timspence.co.uk/gallery
Gallery version: G2 Dark Fibre
Webserver (with version): Unk
Datatabase (with version): MySQL 4.0.23
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system:
Web browser/version:
G1 version (for migration bugs):

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-22 22:29

if you want to redirect old G1 links into G2 then you should use the G1->G2 redirect option in the migrate module, rather than the rewrite module. G1 uses a flat namespace, so if mysubalbum is inside myalbum the url has just gallery/mysubalbum. in G2 this will be gallery2/v/myalbum/mysubalbum. The migrate module can record a mapping so from gallery/mysubalbum it can figure out where in G2 this is. Note that this redirection is currently incompatible with rewrite module..

 
TimmyRaa

Joined: 2005-03-22
Posts: 3
Posted: Thu, 2005-03-24 21:12

Thanks mindless. However, I've gone back to basics to try that; my existing G1 install is back in /gallery/ and my new G2 install is in /gallery2/. I've migrated my G1 albums to G2, and told it to record the G1>G2 mappings. Once the albums are migrated, it gives me some code to add to the .htaccess file in the G1 directory and the albums directory:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !gallery_remote2.php
  RewriteRule (.*)$ /gallery2/main.php?g2_controller=migrate:Redirect&g2_file=$1&g2_%{QUERY_STRING}
</IfModule>

However, it's not working. I'm not sure what's wrong exactly, but it just seems to cause my G1 install to stop working. Actually, I've just read the last line of your post, "Note that this redirection is currently incompatible with rewrite module.." Do you mean this won't work if you have the Gallery rewrite module configured and enabled? If so, what is the impact of not having the rewrite module enabled, and is this something that is likely to get resolved by final release?

Also, so I'm understanding things correctly, I'm presuming in theory with the G1>G2 redirection working, all my images that were linked via http://www.timspence.co.uk/gallery/albums/Barcelona-2005/IMG_1133_lowres.jpg for example, would still be accessible via that address, even though they're now located at (this is the new G2 location) http://www.timspence.co.uk/gallery2/d/410-2/IMG_1133_lowres.jpg? Does that make sense?!? Is that the point of the redirection feature, or am I misunderstanding it?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-03-25 01:03

-- G1->G2 redirection and G2 Rewrite module don't work together in the same .htaccess file.. i think since you have G1 and G2 in separate directories you should be ok.
-- G1->G2 currently only redirects links to pages, not images.. so it can redirect gallery/Barcelona-2005 and gallery/Barcelona-2005/IMG_1133_lowres but not albums/../...jpg

 
TimmyRaa

Joined: 2005-03-22
Posts: 3
Posted: Fri, 2005-03-25 09:12

Ah, okay, thanks mindless. In that case, I think I shall bite the bullet and just move my new gallery and forget about any old linked images or albums.