简体   繁体   English

当 web 应用程序进行维护时,重定向的最佳位置是什么?

[英]What is the best place to redirect when a web application is doing maintenance?

We have a php+mysql web application, and sometimes we need to do some taks of maintenance (like changing files in server or executing scripts to the database)我们有一个 php+mysql web 应用程序,有时我们需要做一些维护工作(比如更改服务器中的文件或执行脚本到数据库)

Before doing this tasks we use to edit a .htaccess file to redirect the users to a "maintenance file".在执行此任务之前,我们使用编辑 .htaccess 文件将用户重定向到“维护文件”。

We use to redirect to我们使用重定向到

mydomain.com/maintenance.html

but we are wondering if但我们想知道是否

mydomain.com/maintenance/

or或者

maintenance.mydomain.com

are better options.是更好的选择。

Is there any reason for choose one of the three (or another different) above the other options?是否有任何理由选择其他选项之上的三个(或另一个不同)之一?

During website maintenance to prevent users accessing the hosting page, you can use the following:网站维护期间,为了防止用户访问托管页面,您可以使用以下内容:

RewriteEngine On重写引擎开启

RewriteBase / RewriteBase /

RewriteCond %{REQUEST_URI}.^/maintenance.html$ RewriteCond %{REQUEST_URI}.^/maintenance.html$

RewriteRule ^(.*)$ http://domain.com/maintenance.html [R=307,L]重写规则 ^(.*)$ http://domain.com/maintenance.html [R=307,L]

to be abled to send all users to a maintenance.html page no matter which page they requested.能够将所有用户发送到维护。html 页面,无论他们请求哪个页面。

If maintenance is actually a section of your website, that is, interactive, with various pages and info about maintenance, then surely, I'd go with the option 2.如果maintenance实际上是您网站的一部分,即交互式的,具有各种页面和有关维护的信息,那么当然,我会选择 go 和选项 2。

Otherwise, mydomain.com/maintenance.html is the less confusing one.否则, mydomain.com/maintenance.html /maintenance.html 是不那么令人困惑的一个。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Java Web应用程序(WAR)中存储配置文件的最佳位置是什么? - What is the best place to store a configuration file in a Java web application (WAR)? 在.NET Web应用程序中使用Response.Redirect到弹出窗口的最佳方法是什么? - What's the Best Way to use Response.Redirect to for A Pop-Up in a .NET Web Application? 在开发/维护Web应用程序时,我应该使用哪种分支策略? - What branching strategy should I use during the development/maintenance of a web application? 配置移动Web应用程序的最佳方法是什么? - What is the best way to profile a mobile Web Application? 创建异步Web应用程序的最佳方法是什么 - What is the best way for creating asynchronous web application 托管一个以上基于tomcat的Web应用程序时的最佳实践是什么 - What is the best practice when hosting more then one tomcat based web application 在ASP.NET中使用Web应用程序时脱机存储数据的最佳方法是什么 - What would be the best approach to store data offline when working with web application in asp.net 开发BlackBerry Web应用程序(WebWorks Application)的最佳方法是什么? - What's the best approach for developing a BlackBerry web application (WebWorks Application) Web应用程序架构-通用解决方案+独立实例->成长与维护? - Web application archirecture - Common solution+independant instance -> Grow & maintenance? 管理Web应用程序权限的最佳方法是什么 - 位掩码或数据库表? - What is the best way to manage permissions for a web application - bitmask or database table?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM