The final task is to search and replace the link to the root index.html in all files, by updating the string href="./index/" to simply href="/": find. from paths in that file: mv index/index.html. You also need to fix the root index.html by copying /index/index.html to /index.html, and remove. Use for example DDEV or Lando to quickly spin up a LAMP instance to test it with: lando init -recipe lamp -name lamp -source cwd -webroot. Note that this only works with a web server configured to add the necessary trailing slashes again and resolve to the actual index.html file. This way it would leave Drupal's non-trailing-space paradigma intact and avoid "duplicate content" issues while preserving absolute paths. name "*.html" -type f -print0 | xargs -0 perl -i -pe "s//index.html///g" In the latter, she furtherly suggests to run a regex on all files to fix link issues with index.html: find. (LOCALSITE is the URL of the site that's being copied, and DESTINATION is the path to the directory where the static pages should go) KarenS has created a very helpful article Sending a Drupal Site Into Retirement Using HTTrack (2014, updated 2020) where she suggests the following code (on a Linux console): httrack -O DESTINATION -N "%h%p/%n/index%.%t" -WqQ%v -robots=0 -footer '' It can also be a good idea to disable any third party dynamically generated blocks once the site is archived, it would be difficult to remove these blocks if the 3rd party services are no longer available.Ĭreate a static clone HTTrack (Linux, macOS, Windows).You can do this through phpMyAdmin by running the following SQL command from the node table:ĭrush sql:query "UPDATE node_revision SET comment = '1' " This will eliminate the login or register to post comments link that would otherwise accompany each of your posts. Update all nodes by setting their comments to read only.Disable ajax requests such as views pagers.comment controls which allow the user to select comment display format.links to the search module and/or any search boxes in the header.Use the Disable All Forms module to disable all forms. if you are archiving a 2008 event, link to the URL of the next event).ĭisable interactive elements which will be nonfunctional in the static HTML version. Consider including a link to the future versions of the site (e.g. Be sure to include the date of the archiving. Prepare the Drupal websiteĬreate a custom block and/or post a node to the front page that notes that the site has been archived from Drupal to static HTML. Note: You should certainly only use this on your own sites. ![]() ![]() How to produce a static mirror of a Drupal website?
0 Comments
Leave a Reply. |