Hi Ralph,
Thanks for that.
I was ready to respond with the .htaccess information but saw your back-and-forth with PP and **HAD** to comment.
In explanation for the serendipity comment, the server must be using index.php somewhere in its DirectoryIndex statement (in httpd.conf). The simple fact that you chose that meant that Apache would serve the (null?) index.php file rather than the (Options +Indexes) directory listing. Serendipity can be a useful tool but, if you actually know what you're doing, you don't need it (Luck - "The Good Lord protects babies, drunks and fools" - and it's best not the be the latter and I'm far too old to be in the first category
).
Actually, I will tend to use (without comments or going into mod_rewrite code):
Code:
# .htaccess in DocumentRoot
# Set Apache Options
Options -Indexes -MultiViews
# Set Directory Indexes
DirectoryIndex index.php index.html home.php other_as_required
# Set ErrorDocument for this domain
ErrorDocument 404 /sitemap.php
# OPTIONAL code to prohibit viewing .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
Explanation(s):
- The .htaccess file is a server file peculiar to Apache in which you can put limited directives aimed at Apache. The only "trick" is to know that (ab)use of .htaccess should be very limited and is only useful to webmasters with no access to the server/virtual host conf files.
- Options -Indexes tells Apache it's prohibited from providing directory listings.
- Options -MultiViews tells Apache NOT to serve files in directory positions in the URI, i.e., NOT to serve http://example.com/index.php/yadda-yadda/whoop-de-do's index.php file and allow it to parse the remaining parts of the path/file in the URI. To make matters worse, +MultiViews will also attempt to serve any extension with the same filename as a directory name in the path - and this trips-up newbie webmasters!
- DirectoryIndex sets the order Apache will search for a default file to serve when no filename is present in the URI. While generally set in the httpd.conf (the server's configuration file), a webmaster can change the default name very easily. This is useful when developing/modifying a website as you can serve a "coming soon" or "update in progress" page simply by changing the order and testing using a direct link to the website's intended (future) DirectoryIndex.
- Apache will serve a default error document script unless you specify one you have built for your website. I've used the Home page (index.php), error.php but I've shown sitemap.php above as a good alternative (it helps visitors find what they're looking for).
- This <Files> wrapper has specified that noone is allowed to see, read, download or even know that an .htaccess file even exists (deny access to all).
When I get lazy, I'll only use the DirectoryIndex and ErrorDocument but the others should be considered the best candidates for inclusion ... with the caveat that you don't need the comments I inserted so they should be removed for efficiency.
I hope that explanation helped everyone.
Regards,
DK
Bookmarks