BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.37k stars 1.82k forks source link

Relative paths for local images #1137

Open jelle82 opened 5 years ago

jelle82 commented 5 years ago

Make the paths to locally stored images relative instead of absolute. For example <img src="/uploads/images/gallery/cat.png" /> instead of <img src="http://bookstack.example.com/uploads/images/gallery/cat.png" />,

It increases portability. f you want to change the domain name for the Bookstack App there is no need to change all the image urls afterwards.

Sibbo07 commented 5 years ago

That would be very helpfull!

ssddanbrown commented 5 years ago

This would be nice but will make the logic more complex. Was a while ago but I think i decided to use full paths since we'd have to handle full paths anyway for external storage systems (S3). Easier to standardise on one format.

andreicocari commented 5 years ago

Would it make sense in that case to have a "base domain" field in the Settings page? I believe Wordpress has a similar approach.

ssddanbrown commented 5 years ago

@andreicocari Yeah, Although we essentially already have this via APP_URL in the .env file.

recklessnl commented 5 years ago

+1 for this!

comnam90 commented 5 years ago

+1 for this, it's needed for environments where the internal and external URLs are different.

GarethFox commented 5 years ago

+1 too ^^ I face the same issue using a temporary url to create content and modifying the url when staging to production environment with final url, all the images are not displayed any more, they are referring to the old url in use when uploaded.

antontkv commented 5 years ago

+1 Have the same issue after migrating to another domain.

Stefansen commented 2 weeks ago

any update on this issues?