A G1 -> G2 circumstantial redirect... maybe you can help?

WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Sat, 2012-01-07 23:28

I started a thread in the G1 forum, but I doubt anyone reads there much anymore, so I'd like to ask for help here, too... The other thread is here: http://gallery.menalto.com/node/104795

Apologies for repeating text, but what I said there I'll say here:

I have upgraded (actually a few years ago) from G1 to G2... I have looked at G3 and don't really like the changes so I think I'm sticking with G2... Anyway... I want to leave my G1 install intact (I'm actually rebuilding some of it after deleting it, because I realized that all the old entries in my livejournal hotlink to images from those urls in my G1 install and when I deleted it they all broke... so I want those to work again)...

What I'd like to do is have pages that are showing a single image to work just like they do, but if someone tries to view an album page, it refreshes the page to the G2 installation front page and the new gallery. I don't want people doing much browsing around in the G1 install, you see, I just want the individual images to be available.

So is there a template somewhere for just album pages or whatever that I could add the refresh tag into the header... but it wouldn't affect the page template? Does that make sense?

Thanks for any help you can give...

--
WebKat, Gallery2 holdover extraordinaire.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-01-08 12:56
 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2012-01-08 17:40

If you have migrated from G1 to G2 by following the recommended steps you shouldn't need any further intervention for your G1 links to be served by G2 and you can actually delete the G1 content afterwards.

If you followed some home brew method, then all bets are off and you will have to figure it out yourself. Suffice to say the effect you describe is of course possible but only with a lot of custom coding. Not something that can be given as a simple answer to a forum post. You will need to hire someone to do this.

As said though, the G2 dev team has provided a way to migrate G1 to G2 that achieves exactly what you want. Use this.

--
dakanji.com

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Sun, 2012-01-08 17:51

I followed the steps provided when I installed G2 several years ago, but the urls to the images are totally differently formed than the G1 urls were. Also, it's on a different domain (gallery2.example.com rather than gallery.example.com). There is no way to "upgrade" it differently at this point as I deleted my G1 entirely (for unrelated reasons) and am only now rebuilding it--and not even the whole thing, just the parts that are likely to have been posted in my journal, so upgrading from my G1 to G2 again would mean losing a lot of content.

I assume there are different templates for showing an image than for showing an album, and I just want to put a redirect tag in the album one... but it isn't obvious to me by looking at the file names.

--
WebKat, Gallery2 holdover extraordinaire.

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Sun, 2012-01-08 17:52

I know how to do redirects, I just need it to only redirect for albums, and NOT redirect for image pages.
--
WebKat, Gallery2 holdover extraordinaire.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2012-01-08 18:23
WebKat wrote:
I followed the steps provided when I installed G2 several years ago, but the urls to the images are totally differently formed than the G1 urls were. Also, it's on a different domain (gallery2.example.com rather than gallery.example.com).

Unfortunately, you didn't follow the recommendation to maintain the same address which would have kept your G2 site as gallery.example.com and which would have removed the issue. Anyway, The best way is to rewrite gallery.example.com to gallery2.example.com and put the rest of the steps with the migration and rewrite modules in place which should give you the desired result.

Quote:
There is no way to "upgrade" it differently at this point as I deleted my G1 entirely (for unrelated reasons) and am only now rebuilding it--and not even the whole thing, just the parts that are likely to have been posted in my journal, so upgrading from my G1 to G2 again would mean losing a lot of content.

Seems like a lot of work. Why not just edit the links in the journal to point to the G2 equivalent.

For gallery.example.com/path/to/G1/item you should be able to use gallery2.example.com/main.php?g2_controller=migrate.Redirect&g2_path=/path/to/G1/item. You will need the migration module and rewrite module as per the recommended steps.

This would only cover the links that you edit and other links elsewhere will be broken.

Quote:
I assume there are different templates for showing an image than for showing an album, and I just want to put a redirect tag in the album one... but it isn't obvious to me by looking at the file names.

Images do not need templates. They are just served directly. If you mean that your links are to image pages rather than for the images to show inline in the journal, then that is another story.

As said though the most straightforward way to to rewrite the entire old G1 domain to the G2 one and to then let the migration and rewrite G2 modules interprete and serve the equivalent G2 resource from the G1 url pattern.

Of course if you never used the migration module or have uninstalled it since, then all that is moot as the mapping data will not exist.

--
dakanji.com

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Sun, 2012-01-08 18:45

The links in the journal are to the image *pages* not the images themselves. As for editing the links, we're talking about 10 years worth of journal entries, and I'd have to look at each one to see if it had an image, and then find the new link, etc. It would take weeks.

And yeah, I had a reason to take down the gallery1 install entirely when I did it, but it's a long story. I'm rebuilding it with only the likely albums to have been linked to from my journal.

--
WebKat, Gallery2 holdover extraordinaire.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2012-01-08 20:16

Good luck.

BTW, the issue is not with you taking down the G1 install as the G1 installation is not needed when all is done if that process is followed.

For the benefit of others that might want to migrate from G1 to G2 directed here by a search engine, note that if you follow the outlined process, G2 will serve the G2 equivalent of all previous G1 links and that you can delete G1 entirely once you are done without any problems. You just have to make sure the migrate module is kept activated in G2 and that the G1 rewrite flag in the rewrite module is in place. Another key consideration is that the G2 domain/folder should stay the same as the G1 one as specified in the document.

--
dakanji.com

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Mon, 2012-01-09 01:28

Ok, well that's good for future people who might find the thread and need to know that info, but for me, do you know what templates I need to edit?

--
WebKat, Gallery2 holdover extraordinaire.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2012-01-09 05:38

See my very first post to this thread.

In terms of specifically editing your G1 templates, I'm afraid that G1 is no longer supported and you will be hard pressed to find information on it. Also, the G1 project is no longer run on this site and was spun off as a separate project called "Jallery" a few years ago. The project website is at jallery.com but that address is not active.

Your options are to either try to directly contact one of the old G1 maintainers to see if they can help or perhaps try to figure out a G1 -> G2 rewrite pattern yourself.

I think the second option is your best bet and should not be too difficult to do in theory.
Install G1, do a migration to G2, see how the URLs relate and craft a rewrite pattern to use for your original G2 site accordingly.

Good luck.

--
dakanji.com

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Mon, 2012-01-09 22:11

I ended up putting the meta refresh tag in the /html_wrap/album.header.default file and now any album page automatically forwards to (the front page of) my G2 gallery. Image pages do not forward. This is exactly what I was looking for. Yay!

--
WebKat, Gallery2 holdover extraordinaire.