mkb
mkb

Reputation: 81

Extra folder name being added to images / links when retrieving content from Joomla Article table

I am creating an external application which retrieves certain article content from Joomla 2.5 tables.

My external application is in a folder named appln. I have a file named article.php. In this file I have retrieved certain articles from Joomla 2.5. I can successfully retrieve the article content and display in my file.

But this issue is the article containing any PDF and Images links, on click of this links the page is displayed as a 404 page not found...

NOTE: The PDF and images files do exits.

The reason is because the path to the images is as follow:

http://www.websitename.com/appln/image1.jpg

The page should be:

http://www.websitename.com/image1.jpg

I am unable to figure out why it is adding /appln/ before the name of the image or pdf file.

Upvotes: 2

Views: 142

Answers (2)

Søren Beck Jensen
Søren Beck Jensen

Reputation: 1676

Because the images are inserted relative like this:

<img src="image1.jpg">

You could probably fix it by adding this to the <head> area:

<base href="http://www.yoursite.com/" />

Upvotes: 0

Nir Alfasi
Nir Alfasi

Reputation: 53525

Look in the plugin code for something like: $document->setBase(...)

Upvotes: 0

Related Questions