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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

Index file for now

Go to End

3 Posts   1836 Views


Community Member, 48 Posts

20 March 2009 at 10:28am

Is there a way to have an index.htm page show up as a "Coming soon" page which everyone views when they goto the URL.... but if i type in a page name i know works... ie about-us/ after the url it will work...

i tried allowing just my IP being able to view the site and everyone else got a maintenance file... however my client is looking at the site in progress as well and they are coming from many IP addresses on numorous machines and maintainting that would be hard work

Is it possible to have the URL goto index.html but allow us to type in a known address to goto that relevant page


Forum Moderator, 1391 Posts

20 March 2009 at 10:13pm

You could start by adding another line to your .htaccess file, right behind where it says: RewriteBase /. this could be someting like

RewriteRule ^$ index.html [L]

(I'm no htaccess expert, but this works for me). If you find you now can no longer reach your homepage from your site's menu, because it now too points to index.html, you need to (temporarily) change your homepage's URL in the backend, where it probably says something like





Forum Moderator, 1391 Posts

21 March 2009 at 10:09pm

Edited: 21/03/2009 10:11pm

Thought a bit further. This works in 2.3.0 on Linux: you could set the base directory for your site to some imaginary 'testingthis' directory, by putting this in the _config.php file of your site (provided your site resides in the root):


Then you could adapt your rewriteRules something like this (quick fix, no expert, see above :-) ):

RewriteCond %{REQUEST_URI} (\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ 
RewriteRule ^testingthis/(.*)$ $1 [L]

RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ 
RewriteCond %{REQUEST_URI} ^(/testingthis)(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%2&%{QUERY_STRING} [L]

You don't have to change the homepage url for this one. You can now call your site in /testingthis/, requesting the root of the site wil redirect to index.html, links to /testingthis/ will be created automatically, and all other pages will give a not found error. This has probably been done better - if so, please point me to it.