[英]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.