Filenames without extensions?

message from bb3 on 23 Jul 2004
My workgroup creates websites using files without extensions on the filename.
E.g., index, advanced, whateverfilename. I've never seen this before, but it
must be a common practice somewhere. Anyway, I've noticed that Dreamweaver
2004 MX does not allow me to open a file that does not have an extension on the
name. Not even to right click and choose an application to open it. I always
thought it would at least open it as a default text or html file. Didn't older
versions of Dreamweaver do this? Is it going to be necessary to copy and add
extensions to all these site files in order to work on them, and them change
them back again to update the server? Is there a setting somewhere in
Dreamweaver 2004 MX that will tell it to open the files?

Thanks very much,
bb3
 
darrel replied to bb3 on 23 Jul 2004
I believe this is an OS-level issue. While the web server doesn't need
extensions, Windows still depends heavily on them. You could try doing this
on a Mac, as Mac's don't REQUIRE extensions, but DW may still prefer them.

-Darrel
 
darrel replied to bb3 on 23 Jul 2004
Oh...and FINALLY...there really is no logical reason to build your site
without file extensions. One argument is that it makes for cleaner URLs, but
that should/could be taken care of via URL rewriting on a layer in between
the browser and the files themselves.

Personally, having file extensions is rather critical when it comes to
maintaining development files.

-Darrel
 
Gary White replied to darrel on 23 Jul 2004
Hmmm... I don't have the time right no to research it, but I wonder if
the server could be coerced into sending the right MIME type for an
extensionless file?

Gary
 
darrel replied to Gary White on 23 Jul 2004
You could probably do that programatically.

-Darrel
 
Gary White replied to darrel on 23 Jul 2004
Yep.

Gary
 
Joe Makowiec replied to Gary White on 23 Jul 2004
Apache, at least, can be convinced to look for a file with an
extension given a call to one without it; in fact, I think it can look
through a hierarchy of extensions, so that a call to
http://mysite.invalid/xyzzy will look first for xyzzy.php, then
xyzzy.html, then ...

From what I've read, it will even work with image files, so you can do
something like:
<img src="cutepicture" width="96" height="146" alt="something">, and at
present it will serve a .jpg file; in the future, when most browsers
get up to speed with serving the next generation of png images, you can
change cutepicture to a png (it would have the name cutepicture.png on
the server) and it would get served up without changing the page source
code.

'Content Negotiation' is the key word here -
http://httpd.apache.org/docs/content-negotiation.html is probably as
good a place to start reading about it as any. There's some stuff at
http://w3.org/ too.
 
Michael Fesser replied to Joe Makowiec on 24 Jul 2004
.oO(Joe Makowiec)

Yes, if there are multiple files with thas name. This comes in handy if
you want to provide the same resource in different representations (for
example different languages or file formats). The server then chooses
one of them according to the browser's preferences.

It works for all. The browser just sends a request for a resource and
the server responds with the representation that fits best. It doesn't
matter if it's a document, an image or anything else.

The server decides according to the Accept-headers sent by the browser.
This allows recent browsers to get the PNG if they prefer it (Mozilla
for example), while old versions still get the JPEG. Additionally the
server could decide whether to deliver HTML or real XHTML (delivered as
(application/xhtml+xml).

Very nice feature. ;)

Micha
 
Michael Fesser replied to Gary White on 23 Jul 2004
.oO(Gary White)

Yep, no problem on Apaches. You can specify default content-types for
all files, if necessary per-directory (with .htaccess files). Another
way could be to store files with extension, but call them without it
(possible with MultiViews). Additionally if the files are scripts then
the script itself can send an appropriate content-type.

Micha
 
Gary White replied to Michael Fesser on 23 Jul 2004
Thanks, Micha. I thought you probably could, but knew it would be more
than just uploading the files and expecting them to display properly.

Gary
 
bb3 replied to Gary White on 23 Jul 2004
Wow, this is great! I did not expect so many responses! Thanks so much
everybody -- these are all fascinating ideas. I don't have control of the
server so I really need to just convince Dreamweaver that it's ok to go ahead
and open an extensionless file. The idea of running a script to add the
extensions to the uploaded versions is a good one (thanks Darrel) -- maybe I
can use my EZMacros program to do that.

bb3
 
darrel replied to bb3 on 23 Jul 2004
Oh...and while not an ideal solution, you could consider using one of the
mass file name search and replace tools out there. Download the site, run
the script, edit all day, and then re-run the script to upload it back at
night.

-Darrel
 

Archived message: Filenames without extensions? (Macromedia Dreamweaver)