Recent Topics

1 Nov 22, 2015 19:15    

I have a testing blog located at domain.com/
_basic.config.php has baseurl http://www.domain.com
When I post to that blog, I manually link images as: <a href="/media/blogs/slugname/this-is-an-image.jpg"><img src="/media/blogs/slugname/this-is-an-image.jpg" /></a>
When I hover the mouse over that image, the link displayed in the bottom of the browser is: domain.com/media/blogs/slugname/this-is-an-image.jpg
Everything in this test blog works properly.

I copied the database to a new database.
I copied the entire blog folder to a new test location: domain.com/subfolder/
_basic.config.php now has baseurl http://www.domain.com/subfolder/

When I load that new test blog, the content displays but none of the images load.
When I hover over them, the link displayed at the bottom of the browser is:
domain.com/media/blogs/slugname/this-is-an-image.jpg
instead of
domain.com/subfolder/media/blogs/slugname/this-is-an-image.jpg

So... what is the correct way to create relative links from blog base to images under /media/ without using the full http://www.domain.com/path/to/media/image.jpg path?

3 Nov 23, 2015 00:09

Using the shortcodes isn't suitable in this case because the images are being framed and arranged in a grid with css.

When I back-reference the path I get the following error on preview, although the image does display properly:

Found invalid URL: URL "../../media/blogs/slugname/name-of-image.jpg" must be a full path starting with "/" or an anchor starting with "#".

4 Nov 23, 2015 15:53

Ah I think that's because relative paths won't work in RSS feeds. Forget my first solution.

The shortcodes can be used with CSS.


Form is loading...