Brian Zelip
Brian Zelip

Reputation: 3201

How to temporarily replace Drupal with static HTML pages?

I'm a JavaScript dev with no Drupal experience.

I'm working with a church to redesign their Drupal site after their dev moved on without leaving any notes/documentation/etc. In the meantime, I'd like to put up a few static html pages in place of the Drupal site, without getting rid of all the Drupal data.

Can I just "turn off" Drupal, so that routes now currently powered by Drupal (ie: church.org/worship) will instead render the static file version (ie: church.org/worship/index.html)?

Is leveraging Drupal's "maintenance mode" a possible solution? I found this article, https://drupalden.co.uk/static-maintenance-page-replace-drupals-default-maintenance-mode-page, on replacing the default maintenance page, but what about other routes too?

Thanks for any help!

Upvotes: 1

Views: 164

Answers (1)

rovr138
rovr138

Reputation: 777

Drupal’s htaccess redirects requests to the index.php when the file or folder is not present on disk.

This is true on 7 and 8.

If you want to place a static page up at /worship/ create the folder /worship and an index.html in it which will get picked up.

The code looks like,

  # 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 link, https://git.drupalcode.org/project/drupal/-/blob/8.8.x/.htaccess#L134-139

Upvotes: 2

Related Questions