I currently own spoilertv.co.uk and have our gallery here
spoilertv.co.uk/images
I also own spoilertv.com and the sub-domain images.spoilertv.com
the current .co.uk gallery has over 120,000 images and 1000+ albumns.
Both .co.uk and .com are on the same physical server.
What I want to do is to move all the files/albumns over to the images.spoilertv.com address.
Now that part is fine and I know how to do that.
The problem I have, is that I have 1000's of articles on my website that link to images on the .co.uk domain
eg
or
Now if I move over to the .com gallery, all these link will break.
Is there anything I can do in terms of a redirect so that those links still work and redirect to their new .com address etc
You did not mention the version of zenphoto you are running currently. That is a critical bit of the answer.
Version 1.4.6 and beyond do not store absolute links in the database. Rather they store tokens that are re-generated to proper links of the current site.
So if you are running successfully on this release you simply backup your database on the old site and restore it on the new one. Be sure that you have moved all the albums and images BEFORE you restore the database. Otherwise the software may think that some have been removed and delete database entries for them.
If these url are really old absolute ones it should be possible to redirect the old domain links to the new via .htaccess. Another way might be to change all urls in the database directly via search & replace. In any case test all before setting the new site live naturally.
Yes, unless you consider changing them that should be a permanent redirect. You might consider that for the site pages itself as well in case people linked to them in the past.
Just in case, try all this with a mirror site if you have the space on your server to do so.
Thanks Acrylian.
Yep, I plan to make a mirror of the files/albums on the new domain.
Then add a new redirect from the .co.uk to the .com and see if the old links/thumbnails redirect correctly to the new domain.
Then fingers crossed, remove the old domain files
Thanks for the help. Much appreciated.
You could also try a manual update of your database. Naturally you should try this on a test copy of the database first:
Using your mysqladmin do an update on the news and pages tables replacing http://www.spoilertv.co.uk/images with {*FULLWEBPATH*} in the columns where you have these links (e.g. the content conlumn.) This will make the links portable like on the 1.4.6 release.
If you have instances where the http:// is not present replace www.spoilertv.co.uk/images with {*WEBPATH*}. But do the FULLWEBPATH first!