2

I'm using Joomla 3.4.5 with SEF and .htacess with cache on.

The image URLs in modules and content are being incorrectly rendered. Sometimes, they are correctly displayed and some other times the following happens:

Instead of rendering:

www.domain.com/images/image.jpg

It is rendering:

www.domain.com/menu_item/images/image.jpg

I'm not sure why this is happening and if it is related wiht .htaccess or SEF, cache or everything.

I'm using the following custom redirects:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteEngine On
RewriteRule ^item/(.+)$ /artigos/$1 [R=301,L]

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>

Which I tried to comment out to check if it helped, but no luck.

Help anyone?

2 Answers 2

1

its about the image path.

for example:

/images/image1.jpg

refers to image in /website-rootfolder/images/image1.jpg

but

images/image1.jpg

refers to: currentUrl/images/image1.jpg

So with slash it means: load image from /root without slash it means: load image from /current url

hope it helps ;)

So for ur example:

www.domain.com/menu_item/images/image.jpg = images/images/image.jpg

just add the remaining slash / (/images/images/image.jpg) and your image on the page is getting loaded from:

www.domain.com/images/image.jpg

2
  • Hmm, interesting, I'm using JCE editor to insert the images, and by default, it enters the path without the slash.
    – user882670
    Nov 10, 2015 at 12:43
  • The Editor should insert it correctly. Let's wait for other answers!
    – user4345221
    Nov 10, 2015 at 12:53
0

In your backend, go to:

Components -> JCE Editor -> Editor Profiles -> Default-> Editor Parameters

and make sure that:

"File Directory Path" is set to "images" (without the quotes).

Save it and then clear your Joomla cache.

If that still doesn't work, then maybe the ordering of your plugins is wrong. Check this post we have written about 4 years ago (it is very old, but it is still valid): http://www.itoctopus.com/images-not-appearing-on-your-joomla-website .

Hope this helps!

1
  • Hello, thanks, I've proceeded as per your instructions in JCE and reordered the plugins. However, when inserting a new image in the editor, the URL is created without the leading slash. In the frontend, the images are show (most of the times).
    – user882670
    Nov 10, 2015 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.