本文介绍了htaccess的:如何重定向所有页面,以保持页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经把一个网站下来约一个半小时,而我们把第二个服务器到位。使用的.htaccess,我怎么能任何要求 domain 重定向到 domain/holding_page.php ?
解决方案 选项+了FollowSymLinks RewriteEngine叙述上 的RewriteCond%{REQUEST_URI}!/holding_page.php$ 重写规则$ /holding_page.php$l [R = 307,L]使用307(感谢 Piskvor !),而不是302 - 的 307指:
所请求的资源所在 暂时得到不同的URI。 由于重定向可以被改变 有时,客户端应该 继续使用Request-URI为 将来的请求。
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 to domain/holding_page.php?
解决方案 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.
更多推荐
htaccess的:如何重定向所有页面,以保持页
发布评论