wallabag: If you change the URL of your wallabag instance, all links to local images are broken

Issue details

When the option Download images locally is on 1 (in Internal Settings → Misc) and if you change URL of *your* wallabag instance , all links to local images are not changed to the new setting, so they are all broken.

Environment

  • wallabag version (or git revision) that exhibits the issue: 2.2.1
  • How did you install wallabag? Via git clone or by downloading the package? make update
  • Last wallabag version that did not exhibit the issue (if applicable):
  • php version:
  • OS: raspbian
  • type of hosting (shared or dedicated):
  • which storage system you choose at install (SQLite, MySQL/MariaDB or PostgreSQL): sqlite

Steps to reproduce/test case

  1. Lets say your URL is http://wallabag.name.tld
  2. In internal settings → misc → URL of *your* wallabag instance 1bis. Put: http://toto.name.tld
  3. Add an article 2bis. Notice you have a 404 error with images because links begin with http://toto.name.tld
  4. Back to internal settings → misc → URL of *your* wallabag instance 3bis. Put: http://wallabag.name.tld
  5. Back to the previous article: your images are still 404 4bis: Note links for images are still with http://toto.name.tld instead of http://wallabag.name.tld

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 19 (5 by maintainers)

Most upvoted comments

What worked for me was go to wallabag directory into app/config/ edit the parameters.yml domain_name to the new domain name. Then go back to the main wallabag directory. Run make install, answer no to clearing anything or creating any accounts.

I had the same problem and fixed it like this (but be aware that this is risky and might cause problems I have missed! Have a backup ready!) You can open the wallabag.sqlite database with sqlite and then

  • change the URL for inline images with update wallabag_entry set content = replace(content, '<old url>', '<new url>');
  • change the URL for the preview image with update wallabag_entry set preview_picture = replace(preview_picture, '<old url>', <new url>').

Again: Do this at your own risk. But it seems to work for me so far 😉