Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

SS3.1.12 does not show images on frontpage


Go to End


6 Posts   928 Views

Avatar
AD5XJ

Community Member, 35 Posts

27 March 2015 at 8:09am

SilverStripe is installed in a subfolder called /ss on my site.

I have a small index.html document in the server root www.laarrl.org/ that looks like this:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script type="text/javascript">
  window.location = "http://www.laarrl.org/ss/ "
</script>
</body>
</html>

This puts the site in context with SS and the index.php.

My problem is that when the site index.html is called the images do not display on the homepage - but if the www.laarrl.org/ss/ URL is used the images do display properly. What am I missing?

This problem was reported by a user on IE8 and my Windows Chrome browser worked fine. I am now checking FireFox and Chrome on Linux Mint 17.1 and it appears there as well. At first, I thought it was a problem with Chrome, but now all browsers have the same problem. This seems to be new since 3.1.10 since I have used SS since 3.1.8 and have not experience this problem before.

Avatar
Pyromanik

Community Member, 419 Posts

28 March 2015 at 2:39am

index.html will never load. If it is, it is because the browser has failed to redirect. Indicating an issue with javascript. Seems unlikely since it's so simple though.

You should read up on how to set up your webserver to redirect (generally through the use of .htaccess, but not always).
This is a required part of the SS architecture, and will cause issues if it's absent or incorrectly configured.

The thing most folks get wrong is not updating RewriteBase when dealing with apache & SS in a subfolder.

Avatar
AD5XJ

Community Member, 35 Posts

28 March 2015 at 4:40am

Edited: 28/03/2015 4:42am

Pyromanik

Thanks for your reply. The .htaccess has been updated with the redirect you mention. No soap.

A search of the forums yields solutions with similar mods to the .htaccess in the /ss subfolder, but that too did not change the situation.

Bear in mind loading of images is the only issue. Images are in a folder called /images in the web root folder referenced from pages by ../images. All other content displays correctly (all text with formatting) - a strange phenomenon.

As I mentioned before, this is a working site and this has only appeared in the last one or two updates to SS initially affecting just IE but now appears on Chrome and Firefox on both Windows and Linux.

Avatar
JonoM

Community Member, 130 Posts

28 March 2015 at 5:32am

Hi ad5xj, something strange is happening with that images folder that I don't think SilverStripe could cause if your setup is as you describe. If you visit http://www.laarrl.org/images/ you'll see the title is "Index of /ss/images". Visiting http://www.laarrl.org/ss/images/ shows the exact same list of files. If you have SilverStripe installed in a subfolder of the webroot named 'SS' I don't see how SilverStripe could have had any role in processing the first request. Do you have any URL rewrite rules or aliases set up on the web root, perhaps in a forgotten .htaccess file?

Do you really need to have ss installed in a subfolder of your site? Why not just install it at the root if it's the main website?
If you need SilverStripe to be installed in a sub-directory maybe moving the images folder inside the ss directory will help?

Just expanding on those questions - when you say you've installed SilverStripe in a subfolder called 'ss' we take that to mean that you have moved all the files that would normally be in the webroot of a SilverStripe powered site in to a folder names 'ss'. Usually the only reason you would do this is if you want the website at '/ss/' to be totally separate to your main website - for instance if you want to have an independent microsite. According to this assumption if all your files for your website are in the 'ss' folder it would make sense for your images folder to be in there too.

By the way, if you are hosting images to be used in the theme of your site (e.g. referenced from templates) these would normally reside within the theme directory, and if you are displaying images alongside or within content on your site these would normally be uploaded through the CMS meaning they would be stored in the assets folder.

Your base tag is indicating that URL rewriting isn't working so I would look in to fixing that up too. <base href="http://www.laarrl.org/ss/index.php/">

Lastly, have you seen the new Lessons available on this site? Might be worth going through them if you have time as they introduce all the fundamental concepts of working with SilverStripe: http://www.silverstripe.org/learn/lessons/ I plan to watch them all myself one of these days as a refresher.

Avatar
AD5XJ

Community Member, 35 Posts

28 March 2015 at 5:53am

JonoM

Thank you for your reply.

I have to make several comments on your post. First, this a site several years old using SilverStripe since 3.1.8. The configuration has worked all this time. Why does it now want something different than before?

On the odd listing of images in the two different folders; I think that is because of the redirection commands in the .htaccess that have been there since day one.

The "need" to have SilverStripe in a subfolder is a subject for a separate discussion. The fact is that this is how it has been since the site launch with SilverStripe. I could move the images to the /ss folder but to what end? It has been working - so why the problem now?

As to using SilverStripe to manage the images, that has never been the case. Some pages (maybe even most) are manually coded HTML5 with embedded images referenced in the code. Again, something that has worked a long time.

You said:
"Your base tag is indicating that URL rewriting isn't working so I would look in to fixing that up too. <base href="http://www.laarrl.org/ss/index.php/">"

I am not clear on what that means - specifically. Your help would be appreciated.

I will check out the new docs and thank you for the reference.

Avatar
JonoM

Community Member, 130 Posts

28 March 2015 at 6:52am

Hi ad5xj,

If you're sure this problem was caused by updating to SS3.1.10 or newer, why don't you try downgrading the site to SS3.1.8 and see if it fixes your problem? I think you'll find it doesn't. I've demonstrated a URL issue affecting the images folder at the root level that could not be caused by SilverStripe if it is isolated within a sub-directory. This is the issue you should focus on if you have problems with images and it is almost certainly an issue with your configuration rather than SilverStripe wanting something new.

If your SilverStripe website is indeed isolated in a sub-directory then there should not be a SilverStripe provided .htaccess in the web root - it should be in the 'ss' directory with everything else. If you have one in the web root and it contains URL rewriting rules you may need to move this file to the ss folder, or modify or delete the rules. Your web host should be able to help you fix these URL/path issues if the solution isn't clear.

Regarding your comments about things that have always worked - I wasn't suggesting these were the cause of your problems but just outlining the 'normal' approach for your information as it may make things easier for you in future. If you use a standard configuration and follow the same conventions as everyone else you're likely to have an easier time with SilverStripe.