Jump to content

Recommended Posts

Posted

If a user enters a URL with just a directory name, what files does the server look for in whch order?

 

I.e. if the user enters http://www.mysite.org/subfolder1, and in the directory /home/myaccount/public_html/subdirectory1 I have some of the files

index.html

index.htm

index.php

index.php3

default.html

etc.

 

Which file does the server return?

 

Thanks - Rowan

Posted
It will return index.html unless you have modified your .htaccess file to do otherwise.

What if there's no index.html file? What other files does it recognise, and in which order does it choose them?

 

How do I alter this in the .htaccess file?

 

Thanks - Rowan

Posted

index.htm, index.php and others.

 

You can add the following to your .htaccess in that directory

 

>DirectoryIndex index.html index.htm index.php index.cgi default.html default.html

 

It will serve the first one if finds in the order you specify them.

 

.htaccess is a text file. You can use the editor in cPanel to create and/or edit it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...