I'm "that close" to having drupal up and running on my website, but I can't post the index.php file until I've got everything configured without hijacking the site's home page.

I'd like to work with a home page called "drupal.php" while I configure Drupal -- and switch it too index.php only after I have everything configured.

I'm not a programmer, but as best as I can tell, I'd want to modify the common.inc file where it currently reads

function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
global $base_url;

static $script;

if (empty($script)) {
// On some web servers, such as IIS, we can't omit "index.php". So, we
// generate "index.php?q=foo" instead of "?q=foo" on anything that is not
// Apache.
$script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === false) ? 'index.php' : '';
}

to do this. Any advice on just how to do this would be greatly appreciated.

Dan Knight, LowEndMac.com

Comments

tidalx3’s picture

why not change the .htaccess file

# Set the default handler to index.php:
DirectoryIndex index.php

to

DirectoryIndex index.html

and then just put up a under construction index.html page and change it back when you are done

Low End Dan’s picture

I don't have access to the .htaccess file, but I've asked the guys running the server if we can do that without messing up other sites on the same machine.

Thanks for the suggestion.

Low End Dan’s picture

The sysadmin has modified the .htaccess file so it doesn't use index.php. However, when I used the index.php page and try to create my admin account, it jumps to my default HTML page. I need to temporarily hardwire things so it will use index.php (or drupal.php) until I can get Drupal to the point where it can go live.

dk

Tommy Sundstrom’s picture

You can install drupal in a subdirectory, making the url something like www.yoursite.com/drupaltest/index.php

You'll find how to do this in the setup instructions (it's easy).

sirex’s picture

I did this very easily, edit includes/common.inc file, and find '$script =', line should look, something like this:

$script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === FALSE) ? 'index.php' : '';

Komment this line, copy it and replace 'index.php' with:

$script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === FALSE) ? 'drupal.php' : 'drupal.php';

When you ar done configuring your site, just uncomment that line and remove yours. Works for me.

fuquam’s picture

That gives me a Parse error: syntax error, unexpected '{' in /home/site/public_html/includes/common.inc on line 1100

Line 1100 is

    if ($script = (strpos('AaDFlM', $c) !== FALSE) {
      $date .= t(gmdate($c, $timestamp));
    }

What needs to change on that line?
Thanks.

plato1123’s picture

I had a similar problem... the original site was at index.htm and I installed drupal to the same folder... querys like
http://www.mysite.com/?q=admin would go to the original index.htm, the original site we wanted to keep up till the new one is ready.

I changed the line:
$script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === FALSE) ? 'index.php' : '';
to ummm
$script = (strpos($_SERVER['SERVER_SOFTWARE'], 'cheese') === FALSE) ? 'index.php' : '';
so since we're not running a "cheese" server drupal uses the lengthier query instead which works properly... such as http://www.mysite.com/index.php?q=admin
:)

syroeshka’s picture

Thank you guys it really helped me much. Only one remark - I had to turn clean urls OFF to start it working..