sylvest Posted September 15, 2008 Posted September 15, 2008 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 Quote
TCH-Bruce Posted September 15, 2008 Posted September 15, 2008 It will return index.html unless you have modified your .htaccess file to do otherwise. Quote
sylvest Posted September 15, 2008 Author Posted September 15, 2008 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 Quote
TCH-Bruce Posted September 15, 2008 Posted September 15, 2008 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.