Different Front Page for Visitors

by Progonat   Last Updated May 16, 2018 14:07 PM

I am looking to create a custom front page for users that are visiting the site. This is a landing page in a way, which will encourage users to register and has different CSS. Once a user is logged in or registered then they can see the normal website. Trying to do this without any modules.

What I have done so far is change the .htaccess file so it loads the index.html first.

Like so:

DirectoryIndex index.html index.php index.htm

The problem with this method is that users who login in still see the index.html page if they click on any link that points to the Home page. Instead I would like them to see the index.php or the normal Drupal site.

If it possible to do this with preprocess page hook? What code should be used?

I am only trying to present a different front page to the visitor when they hit domain.com. All the other pages such as domain.com/about-us and others should display properly regardless of the user role. In other words, I am NOT trying to hide the whole site for visitors.

Related Questions

Drupal 7 Custom Module with custom theme/template

Updated September 01, 2017 16:07 PM

Where is comment admistration template located?

Updated May 13, 2015 12:40 PM

Install without Bootstrap CDN

Updated June 14, 2016 08:03 AM