Drupal 8.

How do I display a simple html page as a front page?

Currently using a theme which is a sub theme of Bartik. Want to display a simple html page as a front page without header, menu, content and footer. The front page must just display what is in the html file (not even user login as that must be displayed only when the url is /user/login).

Created a new file called 'page--front.html.twig', just placed my html elements, yes it is displayed as front page as expected, but /user/login is also routed to this page, and am unable to login to the site (I needed to delete 'page--front.html.twig' and clear the cache to get the login page).

Any suggestions?

Thanks.

Comments

VM’s picture

IIRC user/login should render in page.html.twig not page--front.html.twig

If you are intent on using an index.html, you can drop it in the root of the installation (same level as index.php) and adjust .htaccess if needed to force index.html to be rendered before index.php

# Set the default handler.
DirectoryIndex index.php index.html index.htm
akashlee’s picture

Thanks, it worked.

Created an index.html, and set the following in .htaccess under docroot directory,

DirectoryIndex index.html index.php