htaccess的:如何重定向所有页面,以保持页

编程入门 行业动态 更新时间:2024-10-26 14:32:05
本文介绍了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的:如何重定向所有页面,以保持页

本文发布于:2023-10-31 16:43:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546673.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   页面   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!