I have stick-built a custom Homepage, and then created the website body in a sub-directory with Drupal installed there. I want the Drupal installation to point to the root index file, not it's own "homepage". I'm thinking that changing $front_page to the URL of the root index is the way.

Is that a good (or at least adequate) way to do it? If so, how do I? Or else what?

Comments

francort’s picture

I believe the most consistent way to do this, is give the front page on your theme the appearance of your static front page.
For instance, the breadcrumb "home" link won't change if you just change the $front_page variable. You'll be finding more "little issues" like this if you just replace the variable.

Offlein’s picture

Perhaps the best way to do this would be to, at the top of your page.tpl.php, do:

if (drupal_is_front_page()) {
  drupal_goto('http://www.example.com');
  return;
}

Or even, if you don't want to redirect away, you could do a PHP include of the index file of your actual front page.

--
I was the lead developer for the New York State Senate.

thorshammer’s picture

Thank you francort and Offlein.
Very sound advice about altering the $front_page variable, francort. I have no doubt issues would be waiting in the wings.

The front_page test is a really good solution Offlein, it's what I'm now using.
(Nice work on the NY State Senate site, Craig.)

Offlein’s picture

Thank you!

--
I was the lead developer for the New York State Senate.