Forum Moderators: phranque

Message Too Old, No Replies

Joomla Images in Articles Broken after SEF enabled

         

rolex911

11:26 pm on Mar 27, 2009 (gmt 0)

10+ Year Member



I am having the problem with my joomla site where the image paths are changed by SEF urls. This breaks all of the image paths.

I tried the fix listed in this post.
I added the rule to my .htaccess :
RewriteRule ^([^/]+/)+images/([^./]+\.[^/]+)$ /images/$2 [L]

This rule fixed my problem with the images in the articles.
However, it caused one new problem.
Now, all of the images that are in my templates folder, will not show in the website. So my template does not show up.

It is clearly the rule rewrite that breaks this path.

Does anyone have any suggestions?
Did someone fix the original problem with Joomla SEF breaking all image paths?

If there is a new fix that is not a rule rewrite, then I can probably get my template images back.

Please help

Smokey
San Francisco

g1smd

12:03 am on Mar 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's actually the links on your pages, pointing at images, that break the URLs in these cases.

It is your browser that evaluates the location of those, based on the URL for the current page.

The fix is to change those links on the page, so that they begin with a leading slash, and mention the full folder filepath as well as the filename.

You could instead use the rewrite, but in this case you have found an additional problem with that. That one can be solved by adding a RewriteCond that checks to make sure the templates folder is not the one being requested.

rolex911

3:28 am on Mar 28, 2009 (gmt 0)

10+ Year Member



Thank you very much for your reply. I have tried to change the paths already. First, I read a post that recommended I try to change all img tags to complete/absolute urls. For example, www.example.com/images/1.gif
I changed this in the Tiny MCE editors html view. Each time after I saved the article, the code would be reverted back to the previous relative path. The same happens when I try to add the leading slash to the relative path (i.e. "/images/1.gif".)
So whenever I turn on SEF Friendly URLs, I lose all of the images in my articles.

You mentioned in your post a new rule rewrite to point the joomla system to my template images. I think this would solve my problem. What would that rewrite rule code look like? I have no knowledge about what is in the .htaccess file.

Thanks Again for your Reply

Smokey
San Francisco

[edited by: jdMorgan at 5:47 pm (utc) on Mar. 28, 2009]
[edit reason] example.com [/edit]