Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Global change of URL for images for existing posts?
Hi,
by default Textpattern provide a complete url for images added to any post. Since 2004, I applied directly this method:
http://website.com/images/xxx.jpg
But I have recently moved my textpattern install
from
http://website.com
to
http://new.website.com
So, how to update all images url globally from http://website.com/images/xxx.jpg to http://new.website.com/images/xxx.jpg or /images/xxx.jpg without opening one by one 700 entries?
Thanks in advance for your help,
Edit by gaekwad: fixed Textile.
Last edited by gaekwad (2020-08-26 15:27:52)
j f p
more in TXPmag
Offline
Re: Global change of URL for images for existing posts?
It depends how you were calling the images. Were you using the txp:image
or txp:images
tags?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Global change of URL for images for existing posts?
jfp wrote #325572:
Hi,
by default Textpattern provide a complete url for images added to any post. Since 2004, I applied directly this method:http://website.com/images/xxx.jpg
But I have recently moved my textpattern install
from
http://website.com
to
http://new.website.comSo, how to update all images url globally from http://website.com/images/xxx.jpg to http://new.website.com/images/xxx.jpg or /images/xxx.jpg without opening one by one 700 entries?
Thanks in advance for your help,
Edit by gaekwad: fixed Textile.
Hi jfp,
If you mean you‘ve been using the textile notation, i.e. !http://site.com/images/1.jpg!
then you‘ll need to do a mass search and replace in the database.
See MySQL‘s REPLACE function.
You can run that in phpMyAdmin or another db editor such as Sequel Pro (Mac) in the SQL tab.
Note that you‘ll need to perform the search and replace on the Body
and Body_html
fields to see the results as Body_html
holds the textile pre-rendered as HTML. The same goes for Excerpt
and Excerpt_html
if you have used images there.
Take a backup of your database first in case you need to start over.
BTW: you‘re more flexible In future if you rename to /images…
.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Global change of URL for images for existing posts?
Couldn’t some rewrite rule be in order here?
Offline