Index page redirection

mjs416's picture

They have: 127 posts

Joined: Dec 2003

Well, in the midst of figuring out how I want to go about changing my site around, I have been playing with the idea of using php Nuke for my site. It dumbs down alot of the coding concepts (for those of us not familiar with php syntax).

Anyways, the default index page for a standard php Nuke site is index.php. This is obviously not index.html.

My question is this, since normal servers look for that index.html page when your doamin is typed into a browser, how would I point the browser to index.php instead? I know there exists java code that does that, but could I (for example) contact my server provider and ask them to change something server side?

Any help is appreciated.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

No -- your server (if set up right) tells the browser to look for the index page, if php is enabled, and it will look for "index" or "home" of any extension.

If you're running Apache and you have an index.html and an index.php file, and you want index.php to be the main page (and it's not happening, and you don't want to delete the index.html page):

DirectoryIndex index.php index.html

That will say, hey, grab index.php and if it's not there, then grab index.html.

mjs416's picture

They have: 127 posts

Joined: Dec 2003

Suzanne wrote:

....DirectoryIndex index.php index.html

That will say, hey, grab index.php and if it's not there, then grab index.html.

Is that a command line for the server or something? Where is that entered?

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

mjs416 wrote: Is that a command line for the server or something? Where is that entered?

You place that in a file called .htaccess in the same directory as your home page.

-Greg

mjs416's picture

They have: 127 posts

Joined: Dec 2003

kk, thanks all.

mjs416's picture

They have: 127 posts

Joined: Dec 2003

Well, I have opened the .htaccess file. Just when I think I have the syntax figured out on one thing, another confusing syntax is born. Anyways, below is what the .htaccess file reads:

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

order deny,allow
deny from all
allow from all

order deny,allow
deny from all

AuthName skreklan.com
AuthUserFile /www/s/skreklan/htdocs/_vti_pvt/service.pwd
AuthGroupFile /www/s/skreklan/htdocs/_vti_pvt/service.grp
DirectoryIndex index.php index.html

The bold part obviously added by me. Will that work where I placed the directory index line? Does it need to be placed elsewhere in the file
?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

First, make sure you have a backup of your .htaccess file!

Then make sure you save that puppy as ASCII and you're good to go. Smiling Test, enjoy.

http://httpd.apache.org/docs/mod/mod_dir.html

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.