【问题标题】:How to temporarily replace Drupal with static HTML pages?如何用静态 HTML 页面临时替换 Drupal?
【发布时间】:2020-07-24 06:09:43
【问题描述】:

我是一名 JavaScript 开发人员,没有 Drupal 经验。

我正在与一家教堂合作,在他们的开发人员继续前进后重新设计他们的 Drupal 网站,而没有留下任何笔记/文档/等。同时,我想放置一些静态 html 页面来代替 Drupal 站点,而不需要删除所有 Drupal 数据。

我可以直接“关闭” Drupal,以便现在由 Drupal 提供支持的路由(即:church.org/worship)将改为呈现静态文件版本(即:church.org/worship/index.html)吗?

利用 Drupal 的“维护模式”是否可行?我发现这篇文章https://drupalden.co.uk/static-maintenance-page-replace-drupals-default-maintenance-mode-page,关于替换默认维护页面,但是其他路由呢?

感谢您的帮助!

【问题讨论】:

    标签: drupal static-html


    【解决方案1】:

    当文件或文件夹不在磁盘上时,Drupal 的 htaccess 将请求重定向到 index.php。

    在 7 和 8 上是这样。

    如果您想在/worship/ 上放置一个静态页面,请在其中创建文件夹/worship 和一个index.html,它将被拾取。

    代码看起来像,

      # Pass all requests not referring directly to files in the filesystem to
      # index.php.
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !=/favicon.ico
      RewriteRule ^ index.php [L]
    

    D8 链接,https://git.drupalcode.org/project/drupal/-/blob/8.8.x/.htaccess#L134-139

    【讨论】:

      猜你喜欢
      • 2012-07-08
      • 1970-01-01
      • 2021-05-04
      • 1970-01-01
      • 1970-01-01
      • 2013-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多