php - index page wont display

5 replies
  • WEB DESIGN
  • |
My first tries with php have been unsuccessful. I have created two new sites using php and both are doing the same thing. I modified a template.

When I type in the url I get a blank page. If I type in the url/page name, it comes up fine.
Without: http://www.rabbits-health-care.us --With: Training Rabbits

There is an index.php page that apparently rotates the main page. The only thing I've modified is to make sure that all my webpages are listed on that index.php page.

text from index.php
<?php
// Set how often home page changes - in seconds (recommended period is 86400 for 24 hours)
$lockperiod = 86400;


$filename = array ();
$filename[0] = 'what-do-rabbits-eat.php';
$filename[1] = 'training-rabbits.php';
$filename[2] = 'baby-rabbit-care.php';
$filename[3] = 'holland-lop-rabbits.php';
$filename[4] = 'lop-eared-rabbits.php';
$filename[5] = 'rabbits-diet.php';
$randpos = (intval(time() / $lockperiod)) % 10;
$filepath = $filename[$randpos];
include $filepath;
?>
#display #index #page #php
  • Profile picture of the author soffell
    Open .htaccess and add

    Code:
    DirectoryIndex index.php
    {{ DiscussionBoard.errors[1206393].message }}
    • Profile picture of the author LadyL08
      Originally Posted by soffell View Post

      Open .htaccess and add

      Code:
      DirectoryIndex index.php
      Couldn't find it/didn't have it. I just deleted the index that rotated the pages and put a static page in it's place.

      Thanks for the input.
      Signature

      LadyL

      {{ DiscussionBoard.errors[1209813].message }}
      • Profile picture of the author robbluther
        You can login to your control panel and set the .php extension to be the primary extension. Right now it sounds like .html is taking the priority. You can also contact your hosting provider and they should do it for you.
        {{ DiscussionBoard.errors[1209818].message }}
  • Profile picture of the author NowIstheTime
    Hi LadyL08, Did you get your site up? You can use robbluther's option if you plan on making the *.php extension, the primary extension going forward... but for now you can simply check to see if there are any index.html pages in the root directory.

    Most likely it is blank, and the likely culprit. Try renaming that index.html page to something else, ex. index.html.old and I believe your site should work.
    {{ DiscussionBoard.errors[1223917].message }}
    • Profile picture of the author surgematrix
      I hope you have your site up now. It it is not, make sure you do not have both index.htm and index.php in your root directory. If you do, the index.htm is what is showing up.
      Signature

      Fight Phishing Attacks, BEC, Ransomware Data Breach & other Threats
      https://tangabyte.com
      Free Reseller Account: https://hostingbizresellers.com

      {{ DiscussionBoard.errors[1224102].message }}

Trending Topics