Sometimes it’s nice to have admin on a different host (admin.mysite.com) then the actual site (www.mysite.com).
If admin.mysite.com is not publicly accessible, then images attached to posts on admin.mysite.com will not be accessible on www.mysite.com since the url to the attached image is absolute and contains the domain (admin.mysite.com).
Is there any way to fix this? The nicest way would be if the url to an attached media would be relative and not absolute.
you can configure the tinymce to use relative paths for images using the
tiny_mce_before_init
like this:I found another way of doing this. I added the following to functions.php:
This way wordpress stores the relative URL in the db.
For more detailed instructions see the blog where I learned about this.