Forum Moderators: phranque
/images/logo
. . . and the server is supposed to choose the file named "logo," regardless of whether it's a jpg or a gif. The same strategy allegedly works with webpages themselves, too.
The advantage, of course, is that you can change your file extensions and still have the result you want without updating all your pages. I can see how that would be handy in many cases; for instance, I just recently learned how to edit my .htaccess file to allow .html files to include SSI's. So if all my links looked like this . . .
mysite.com/aboutme (no extension)
. . . I wouldn't have to update the links even after I change from .shtml files to just .html.
So I thought this sounded pretty great and went to test it out. Of course it didn't work. Apparently there's some sort of server configuration I need to work out. Does anyone else have experience with this scenario?
I'd link to the w3c article, but somehow can't find it now. (It was one of those "tips of the day" that you see when a page validates correctly. A detailed site search at w3c hasn't found the right article yet.)
W3C on Content Negotiation [w3.org]
Jordan
I don't think SSI can direct a non-file-extension request to a specific location with file extension. i.e. mydomain.com/file-a to mydomain.com/file-a.html Actually, I don't know how to set up SSI without file extensions.
If you don't just want to update all the links in your website, you don't need to use SSI; you can forget about file extension, or you can make up an extension.
After making an shtml file, rename it without extension ("file-a.shtml" to just "file-a") or change the extension you like ("file-a.shtml" to "file-a.aaa" .aaa as an example.) When you want to change shtml file to html file, do the same thing after making html file. (rename file-a.html" to "file-a" or "file-a.aaa") Either way, you don't have to update the links.
If all pages were static, everything would work fine. If your site has dynamic pages, it might still works on dynamic pages, but you should test profusely.
Apache does this by mapping your request for index.html to one of index.html.<language>[.<encoding>], so no MIME types are guessed. Guessing MIME types on the client is an evil thing to do (IE does it).
Mozilla's Accept headers are:
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,
text/plain;q=0.8,
video/x-mng,image/png,image/jpeg,image/gif;q=0.2,
*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Linebreaks added to prevent wrap.
Thus, in my opinion, for language it's best to give the user a list of choices and then use session-variables to serve the correct language version of the site
On the other hand, I've successfully content-negotiated based upon the Accept header serving xml to Gecko-based browsers and html to those not understanding xml.