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

Underconstruction Mode


Go to End


6 Posts   2085 Views

Avatar
Beck

Community Member, 23 Posts

4 August 2009 at 7:12pm

Hi everyone! i want to make website not to publish. i mean: design, content, etc... like Underconstruction Mode. how can i do this?
i've changed .htaccess but couldn't get what i want. does anybody have any idea?

Thanks in advance

Avatar
bummzack

Community Member, 904 Posts

5 August 2009 at 12:42am

Well, you could simply comment out or remove the .htaccess file and put up a index.html file which the webserver would display.
You should be aware, that this procedure will also remove the possibility to access the CMS itself though.

Avatar
AdamJ

Community Member, 145 Posts

5 August 2009 at 3:00am

If I remember correctly, you can target htaccess rules at ips. Maybe you could say that any ip except yours will see the construction page, where you will see the site as normal.

Avatar
Beck

Community Member, 23 Posts

7 August 2009 at 9:12pm

htaccess rules at ips like this?

order allow deny
deny from all
allow from <your ip>

Avatar
Beck

Community Member, 23 Posts

9 August 2009 at 5:58am

i talk to darkmonkey in SS's chat:
why not put it in the non-base folder
save yourself from messing around with htaccess
./index.html <- under construction page
./new/

He means:
www.domain.com/index.html <--under construction page
www.domain.com/new/ <-- SilverStripe

when it's ready to publish, just change directory to www.domain.com, then ofcourse www.domain.com/dev/build?flush=1

Avatar
bummzack

Community Member, 904 Posts

9 August 2009 at 8:37am

Edited: 09/08/2009 8:38am

Yes, that would be a solution.

The IP based approach would work too. Add something along these lines to your .htaccess.

RewriteBase / 

RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)|(\.php$) 
RewriteCond %{REMOTE_ADDR} !^127.0.0.1
RewriteRule .* index.html [L,NC]

You would have to replace the IP (red) with a valid address. All IP addresses other than the provided one will be redirected to index.html. This way you can still access the CMS and your Site, while all others just see the index.html page.