SEO optimisation breaks "insert image" URLs for sub-pages

Bug #918461 reported by Ben Linsey-Bloom
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Pluck CMS
Fix Committed
Low
Unassigned

Bug Description

To recreate problem...

Log in to Pluck
Enable SEO optimisation module/htaccess
Create/edit a page/blog post
Insert an image using the "insert image" feature on the right of the page
Select an option from the "sub-page of" drop-down menu.
Save and exit
View site

On a top-level page the image you inserted will appear correctly but if you navigate to the sub-page the image you inserted will not appear. The page source shows me the following:

IMG SRC with SEO :
example.com/sub-page-name/image.jpg (wrong image location )

IMG SRC without SEO (.htaccess file removed):
example.com/images/image.jpg (correct image location)

I don't know how to fix this so I'll have to disable SEO for now. I'm guessing what it would need to do is detect when you're on a sub-page and change the relative file-path to "../images/image.jpg" or use a global variable to store the site's root and have all image URLs relative to that.

Pluck is a great project by the way; let me know if I can help.

A_Bach (ekyo-serwis)
Changed in pluck-cms:
status: New → Fix Committed
importance: Undecided → Low
Revision history for this message
simonv (simonverduin) wrote :

There is a work-around for this issue. It surely isn't pretty, but it will allow you to keep SEO activated:

Open your FTP client.
Go to the location where the file is stored. (i.e. 1.news.php)
Download this file.
Open it locally. Seek the link location and change "images/news.jpg to "http://www.domainname/pluck/images/news.jpg".
Do so for each image.
Save the file, upload and overwrite the original file on the server.

Not a pretty solution, but so far the only thing that worked for me without messing about PHP code.

Simon

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.