Forum Moderators: phranque

Message Too Old, No Replies

The "trailing slash" problem for local website copies

Make local website copy same as remote.

         

ronburk

5:16 am on Mar 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most webservers use some convention to map a resource whose name ends in "/" onto a filename in the server's filesystem. For example, Apache likes to map "/somethingA/somethingB/" to a path that ends in "/somethingA/somethingB/index.html".

For a variety of reasons, it is desirable when referring to such resources to not refer to the generated filename. That is, it is preferable to link to "/somethingA/somethingB/" rather than to hard-code links to "/somethingA/somethingB/index.html", even though they both will produce the same resource.

Fine and dandy. Unless you like to maintain a local copy of your (presumably mostly static) website on your local disk, so that you can browse it locally to check things out before uploading changes. The problem is, IE knows nothing about your convention for mapping trailing-slash resources to filenames. When you ask it to browse "f:\website\docs\somethingA\somethingB\", it simply displays a directory listing instead of displaying the contents of "index.html" in that directory.

Anybody got a neat hack for dealing with this issue? Currently, I just constantly do the extra double-click on "index.html" after IE shows me a directory listing I didn't want to see. I figure I've now wasted more time on such double-clicks than it would take me to post a question about it, so here it is :-)

andye

8:38 am on Mar 1, 2006 (gmt 0)

10+ Year Member



Anybody got a neat hack for dealing with this issue?

You could run Apache on the local machine.

If this is the only issue though, then I'd say it's not worth the faff.

hth, a.