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.

General Questions

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

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

Unable to configure Gallery (


6 Posts   2035 Views


26 October 2009 at 11:04am Community Member, 30 Posts


I have installed Gallery software ( to my website, however can't access the startup page in order to configure and set-up.

I keep getting silverstripes message saying that this page cannot be displayed.

I know this must be something to do with the silverstripe and/or permissions as this software works fine on non-silverstripe websites.

What do I need to do to the folder and/or page ( in order to display this 3rd party software so I can configure and set-up?




28 October 2009 at 8:14am Community Member, 48 Posts

I use gallery with my SilverStripe site. SilverStripe wants to manage everything in its directory, even subdirectories. You need to modify the .htaccess file that's in your silverstripe directory to tell it to pass requests to the photogallery directory. Add these two lines to your .htaccess file just above the existing rewrite condition statements (after the RewriteBase line).

RewriteRule ^photogallery$ photogallery/ [R,L]
RewriteRule ^photogallery/(.*)$ photogallery/$1 [L]

Not sure how familiar you are with gallery, but it's fairly easy to add your header info from Silverstripe to it to make it look like your photogallery is part of the rest of your site.


28 October 2009 at 9:21am Community Member, 30 Posts

Thanks for the reply. To get around the problem I installed Gallery 2.3 under a sub-domain for the website, and seems to work. I will give you idea a go as I prefer to have installation in a sub-directory, not a sub-domain.

Can you explain how to add header from silverstripe?




28 October 2009 at 9:41am Community Member, 30 Posts

The re-write rule worked - thank you :-)


28 October 2009 at 10:59am (Last edited: 28 October 2009 11:32am), Community Member, 48 Posts

Adding SilverStripe header to Gallery. I'm assuming you're using Gallery v2.x. Also, I forgot to mention that the header isn't going to be dynamic. If you add/change any of the header menu picks you'll have to change them in Gallery too.

In my case I'm using the matrix theme in gallery. go to your photogallery/themes/matrix/templates directory. Create a sub directory called local and copy the theme.tpl file to the local directory. We don't edit the default template, but this copy takes precedence. Edit the newly copied local/theme.tpl file.

We need to insert a few things from your silverstripe site. We need to insert the stylesheet info and the basic html that builds the header. Get that by doing a view source on your site in a browser. You'll see there is already a stylesheet in the theme.tpl just copy and paste your stylesheet line in after it. You may have to edit it (I did to give it the full path to it).

Then I copied from the viewed source from my "<div id="BgContainer">" to the closing series of </div> for the navcontainer.

Here is what the top portion of my theme.tpl looks like

* $Revision: 16727 $
* Read this before changing templates!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html lang="{g->language}" xmlns="">
{* Let Gallery print out anything it wants to put into the <head> element *}

{* If Gallery doesn't provide a header, we use the album/photo title (or filename) *}
{if empty($head.title)}

{* Include this theme's style sheet *}
<link rel="stylesheet" type="text/css" href="{g->theme url="theme.css"}"/>
<link rel="stylesheet" type="text/css" href="" >
<body class="gallery">
<div id="Container">
<div id="Header">
<div id="LinkBar">
<div id="Navcontainer">

<ul id="Navlist">
<li><a href="/home/" title="Go to the Home page" class="current">Home</a></li>
<li><a href="/photo-usage/" title="Go to the Photo Usage page" class="link">Photo Usage</a></li>
<li><a href="/contact/" title="Go to the Contact page" class="link">Contact</a></li>
<li><a href="/keeping-your-memories/" title="Go to the Keeping your Memories page" class="link">Keeping your Memories</a></li>


<div {g->mainDivAttributes}>
* Some module views (eg slideshow) want the full screen. So for those, we don't draw
* a header, footer, navbar, etc. Those views are responsible for drawing everything.
{if $theme.useFullScreen

Hope this helps. You can view my if it helps by going to: silverstripe photos using Gallery

Good luck!

Forgot to mention that you'll have to log in to galley, go to site admin, maintenance, then delete template cache to see the changes.


28 October 2009 at 2:23pm Community Member, 48 Posts

My copy and paste is a little messed up.
<body class="gallery">
the Should be <div id="BgContainer">

Not sure what happened there, but you get the idea.