21286 Posts in 5733 Topics by 2602 members
General Questions
SilverStripe Forums » General Questions » redirecting public to temporary holding/under construction page while I'm still able to test the actual silverstripe website in the background
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1765 Views |
-
redirecting public to temporary holding/under construction page while I'm still able to test the actual silverstripe website in the background

22 April 2010 at 1:33pm
Hi all I am trying to get my .htaccess to point to a temporary (under construction page) while allowing me to test the Silverstripe site in the background.
I found a post by willr relating to this http://www.silverstripe.org/general-questions/show/256493#post256493 and have tried his method but I can't seem to get it functioning, hoping someone might be able to take a peek at my updated .htaccess and see if they can see anything wrong...
heres my .htaccess http://pastie.org/private/s34el6woi1viqzdvxknpw
any help would be great,
-
Re: redirecting public to temporary holding/under construction page while I'm still able to test the actual silverstripe website in the background

22 April 2010 at 6:59pm
Rather than messing with the .htaccess, what I would do is put the Silverstripe site into a subdirectory, and then just have the root directory index.html be the under construction page.
Then when you are ready to put the Silverstripe site live, you delete the index file, move the Silverstripe site out of the subdirectory, change one word in the .htaccess file, and you're done.
-
Re: redirecting public to temporary holding/under construction page while I'm still able to test the actual silverstripe website in the background

22 April 2010 at 10:34pm
ampedup yeah I've done something similar, used a subdomain and do the testing there.
-
Re: redirecting public to temporary holding/under construction page while I'm still able to test the actual silverstripe website in the background

23 April 2010 at 1:14pm Last edited: 23 April 2010 1:23pm
Cool. I've had a look at how to do this, and what the problems might be.
Firstly you need to remove comments like this <!--- LINK TO YOUR TEMP PAGE FILE. They break the .htaccess file
Secondly, you need to keep in the original Rewrite stuff, to make sure that silverstripe will still process for you:
RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]So your .htaccess file should look something like this:
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files><IfModule mod_rewrite.c>
RewriteEngine OnRewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_HOST} !^888.888.888.88
RewriteRule $ /maintenance.html [R=302,L]</IfModule>
### SILVERSTRIPE END ###Hope this helps/works
-
Re: redirecting public to temporary holding/under construction page while I'm still able to test the actual silverstripe website in the background

23 April 2010 at 1:50pm
Hi ampedup, yeah I did end up pickup up those few errors and got to the point where I could allow access via IP, but that is not much use to your clients for when they test and I don't know their individual IP's etc. So going the subdomain way is much better.
| 1765 Views | ||
|
Page:
1
|
Go to Top |


