Web Hosting Talk







View Full Version : index question


Smash World
08-02-2001, 05:02 PM
i dont know if this topic is in the right room.

Anyway how do you make it so that when you type in yourdomain.com the index is your forums, like here at webshotingtalk.

bert
08-02-2001, 05:12 PM
Just install your forum script on the root of your site.

Hope this helps.

Smash World
08-02-2001, 05:25 PM
So instead of installing it in like the UBB folder, I woudl install it in the HTdocs folder? But Im still confused on how you get the main forum page (a cgi page) do show up as the index. Doesnt it have to be named index.html?

bert
08-02-2001, 05:29 PM
Exactly, install it on your htdocs or public_html directory. If it is a php script, most apache servers are configured to show the index.php file, if it is a cgi script, the easiest way of doing it would be to create a blank index.html file with a "refresh" meta tag that can redirect users to your script.

Palm
08-02-2001, 05:36 PM
In the httpd.conf under VirtuaHost find your account and put

DirectoryIndex [filename]

Instead of filename you can pick which file to load when the website is activated.

bert
08-02-2001, 05:41 PM
Palm. I don't think he has access to the httpd.conf file. This is the reason why he asks how to do this. I might be wrong, but I think this is the case.

Cyberpunk
08-02-2001, 05:52 PM
On a blank document use an exec cgi command to the script and name it index.shtml and when people hit the root of your site they'll actually see the output for the index page of the script called into an html document.

(Include virtual may work if youre not allowed use of the exec command).

bert
08-02-2001, 05:59 PM
Excellent Cyberpunk. Didn't think of that.

Palm
08-02-2001, 06:32 PM
Use .htaccess then.
Put that line in and see if it works.

Smash World
08-02-2001, 06:35 PM
sorry but would anyone mind giving maybe more specific instructions, like the code and stuff. Sorr yI dont know how to do it :(

bert
08-02-2001, 06:55 PM
No problem. I am not going to explain the SSI method because it will be more complicated for you to setup.

Simply create an index.html file like this:

<html>
<head>
<meta http-equiv="refresh" content="0;URL=script.cgi">
</head>
</html>

Change script.cgi for the actual name of your script file. All this will do is redirect the users to the script file.

This is not the best way to do it, but it certainly works well. ;)

Cyberpunk
08-02-2001, 07:05 PM
Using a blank document, (no html tags at all like head, body etc) enter this for the exec method:

<!--#exec cgi="/path from the public root of your site to/whatever.cgi" -->

and rename the document to .shtml

Using the include method (if your host has disallowed exec command for security, and if the script works ny this type of call:

<!--#include virtual="/path from the public root of your site to/whatever.cgi" -->

again rename to .shtml

The document should be absolutely blank of html otherwise (Your forum creates its own header etc?) you would get repetition of head tags etc in 1 document if you see what I mean.

Hope that helps.

Cyberpunk
08-02-2001, 07:08 PM
If thats too much heres a php twist on the refresh.

Again, totally blank document:

<? header ("Location: http://www.yoursite.com/path to file or script"); exit; ?>

Save it with a .php extension and this will almost instantly bump anyone hitting this document on to where you want them to be. Assuming you have the ability to run php.

Smash World
08-02-2001, 08:31 PM
I will out the mthods and choose which one I like best! Thanks so much for your help!

Cyberpunk
08-02-2001, 09:18 PM
How you got on.

Feel free to pm me or whatever if u think I can help any more.

Chicken
08-02-2001, 11:02 PM
Originally posted by Palm
Use .htaccess then.
Put that line in and see if it works.

In my opinion this is the first and best option you should try. Exact instructions:

Install your forum in your lowest web directory (htdocs, public_html, or web directory).

Fire up notepad.
Put this one line:

DirectoryIndex index.php index.php3 index.html index.htm

(If your file is called something else, then be sure you list it here).

Save file.
Upload file in ascii mode to the same directory.
Rename current index.html file in dir (if any) to something else.
Bingo, forum loads.

I dunno, I guess it doesn't matter much how you do it, I just prefer this method.

Wassercrats
08-02-2001, 11:06 PM
And remember to name your homepage index.htm or index.html. This isn't always necessary, but may be the problem.

Smash World
08-04-2001, 02:20 PM
Chicken - the file name i want to show up as the index is ultimatebb.cgi, not a PHP file.

I have a question. Which files should I upload in the public_html. The CGI files, or the non CGI files? If I put the cgi files in it woudl I have to CHmod my public_HTML directory to 755? Thanks for your help!

bert
08-04-2001, 02:24 PM
Your public_html directory should be chmod to 755 by default. You can put cgi files there as long as the server is configured to run cgi scripts outside the cgi-bin.

Smash World
08-04-2001, 03:11 PM
Originally posted by Chicken


In my opinion this is the first and best option you should try. Exact instructions:

Install your forum in your lowest web directory (htdocs, public_html, or web directory).

Fire up notepad.
Put this one line:

DirectoryIndex index.php index.php3 index.html index.htm

(If your file is called something else, then be sure you list it here).

My forum index is ultimatebb.cgi. So what would My line be, this?:

DirectoryIndex ultimatebb.cgi





Save file.
What should i save it as (filename)?


Upload file in ascii mode to the same directory.
Rename current index.html file in dir (if any) to something else.
Bingo, forum loads.

I dunno, I guess it doesn't matter much how you do it, I just prefer this method.


thanks, i just had those few questions.

Chicken
08-04-2001, 05:43 PM
Bert made a good point, but assuming that isn't an issue (if it is, then there are additional things you'll have to do)...

Yes, your file should be this:

DirectoryIndex ultimatebb.cgi index.html index.htm

You can list others, just realize that it is an .htaccess so any directories within this directory will follow the rule you put here. If you leave off the index.html bit, and have a .html file in another folder, you'll get an index. Really besides the point, and hopefully this doesn't confuse you.

Save it as htaccess (which will actually be htaccess.txt) and once you upload it (in ascii), rename the file .htaccess and you should be good to go.

Cyberpunk
08-04-2001, 08:20 PM
And you probably only wanted or thought you might only get a little advice here :D

JustinK
08-04-2001, 08:59 PM
Then put this inside an .htaccess file and upload it to that directory:

DirectoryIndex ultimatebb.cgi index.php index.php3 index.html index.htm


DirectoryIndex just makes the server look up the specified files for a directory if one isn't specified in the URL. It goes one by one until it either finds one of the index pages or comes up with a 404 page (possibly the directory listing depending on how the server is configured). I use the same thing for mine except I use vbulletin.

- edit -

Dangit. I don't type fast enough anymore. Powerade isn't worth the $$$, I'm switching back to Pepsi & Mountain Dew.

Smash World
08-04-2001, 09:08 PM
Thanks. Im going to attempt the .htaccess thing now. If it doesnt work IM sure you'llhere from me ;)


oh one more thing: I currently have a custom error page thing in my .htaccess file now. Should I insert this Directory index line before or after, and do spacs matter (im not familar with htaccess files)

Thanks again guys, you are doing me such a big favor!!

JustinK
08-04-2001, 09:16 PM
I don't think it matters. You should be able to put it below or above. *edited due to powerade slowing down mind earlier*

Wassercrats
08-04-2001, 11:12 PM
SOMEONE SAID:
Your public_html directory should be chmod to 755 by default.
---------------------------

Maybe it should be that way, but I just had to get Digital Zone's customer service to change a file in the cgi-bin subdirectory of my public_html directory to 755. Their file manager didn't even let me do it.

bert
08-04-2001, 11:28 PM
What I meant to say is that "by default" most directories including the public_html or htdocs directory should be set to 755.

Anyhow, Chmod settings are supposed to be changed either with an FTP client of through the shell if you have telnet/ssh access. ;)