htaccess: how to redirect all pages to a holding page

前端 未结 3 809
闹比i
闹比i 2021-01-06 04:57

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 d

3条回答
  •  抹茶落季
    2021-01-06 05:14

    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.

提交回复
热议问题