I have to put a site down for about half an hour while we put a second server in place. Using .htaccess, how can I redirect ANY request to domain.com
to domain.com/holding_page.php
?
views:
148answers:
2
+1
A:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/holding_page.php$
RewriteRule $ /holding_page.php$l [R=307,L]
Use 307 (thanks Piskvor!) rather than 302 - 307 means:
The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests.
Dominic Rodger
2010-03-02 09:10:16
+1, but in this case I'd use temporary redirect: [R=307,L]
Piskvor
2010-03-02 09:23:26
@Piskvor - excellent suggestion, edited in!
Dominic Rodger
2010-03-02 09:25:34
This is giving me an Internal server error?
stef
2010-03-03 14:23:31
This seems to workRewriteEngine onRewriteCond %{REQUEST_URI} !/indexTEMP.php$ RewriteRule $ /indexTEMP.php [R=307,L]
stef
2010-03-03 14:28:40
A:
This works better...
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/holding_page.php$
RewriteRule $ /holding_page.php [R=307,L]
Antony
2010-04-22 06:08:07