I have one dynamic website with back end control panel which contains ckEditor for data entry.
ckEditor inserts images with path like: /userfiles/image1.jpg
You can define a <base>
in your <head>
:
http://www.w3schools.com/tags/tag_base.asp
To do ist with PHP is hard. Changing it beforehand to an absolute URL might be the best way, changing it afterwards means HTML scanning, finding the images, check wether the url is absolute or relative and change it, if needed.