Forum Moderators: coopster

Message Too Old, No Replies

How to convert index.php to index.htm

         

alxstatik

7:21 pm on Jul 20, 2008 (gmt 0)

10+ Year Member



I'm new to php scripts so I hope you can bear with me. I recently used glype script for a proxy site that I setup successfully. I customized a template to my liking and am now ready to show it publicly. Now since all the files that I've worked with to setup my website are all .php files I have a blank index.htm. Now I know this is the reason that I get a blank page when I type my domain name on the address bar, which now I just have an under construction notice. Now I've read that not every browser can read php so I don't want to delete index.htm. Is there a way to just convert the main.php, index.php or for that matter all the .php files to work with index.htm? I really don't understand what to do. Any help with this is much appreciated.

cameraman

8:26 pm on Jul 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, alxstatik!
To my knowledge there's no such thing as a browser that can't "read php" - the server processes the php script and sends HTML to the browser, so as far as the browser's concerned there's no difference. Just for grins, point your browser directly at the script:
http://www.example.com/index.php

There's a couple of ways you can make the scripted content show up without specifically asking for it:

  1. If you can modify the .htaccess file (for apache servers; I have no idea what it is for IIS), add a line similar to:
    DirectoryIndex index.php index.html index.htm
    If a line like that is already there, make sure index.php is ahead of the other ones.
  2. Add a meta redirect to the header of the htm file:
    <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://www.example.com/index.php">

alxstatik

10:20 pm on Jul 20, 2008 (gmt 0)

10+ Year Member



I did what you said and now I get this error on my page

Warning: require_once(includes/init.php) [function.require-once]: failed to open stream: No such file or directory in /#*$!x/#*$!#*$!/public_html/index.php on line 13

Fatal error: require_once() [function.require]: Failed opening required 'includes/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /#*$!x/#*$!#*$!/public_html/index.php on line 13

I even tried moving my index.php over to my root folder but I still recieve this message.

cameraman

10:33 pm on Jul 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That means the script (index.php) is looking for that file. Check to see if you do in fact have a subdirectory of public_html named includes and a file in it named init.php.

Could it be part of glype? I'm not familiar with that application. If so, then it's possible that glype isn't properly installed.

alxstatik

1:34 pm on Jul 21, 2008 (gmt 0)

10+ Year Member



Thanks you were right. There was a directory called includes/init.php and I just moved it over to the root folder. I guess once this folder is moved to public_html you can no longer view your site and you have to purchase a license because all I get is a link to the glype homepage. I hope it works after purchasing it. Thanks again.