Matt, just a short reason why you should not have an extension on a URL but a / at the end when going to a web pages (you are correct about PDF/EXE etc) is that it's a W3C recommendation as you can quickly change the underlying programming tools. i.e. changing from .NET to a php driven website would not need a mountain of re-directs.
I would personally always end my urls with / rather than .aspx, .htm, .php
@andrewkillen0726 Agreed. This can also extend to the non-HTML-like file types, such as images, stylesheets, scripts, and others. Rather than attempt to hard-code a mime-type in the file name (and also in the HTML in the case of style and script tags), why not let your server do it in the headers like it's supposed to? That frees you to serve up different file types to different users. For instance, src="/images/logo" could serve a .gif to ancient browers and a .png to everyone else.
@mhixson1 Not sure I would go that far as to rely on mime types for CSS and images. and definitly not for PDF exe and the like. Personally I like to let people know what they are getting before they get it with they mouse over a link. When I see something ending with a / I expect it to be a web page and nothing else.
@andrewkillen0726 Sorry, I was unclear. I was thinking more about resources included within the page, not resources that appear as links. There, the file extensions are for the developers' benefit alone, so you may as well do what makes sense programatically. See the source of the WHATWG homepage for examples.
How about is you use Drupal? Should you then add the .html? Some dynamic sites do that, with other CMSs as well.
kleinespelvids 10 months ago
Matt, just a short reason why you should not have an extension on a URL but a / at the end when going to a web pages (you are correct about PDF/EXE etc) is that it's a W3C recommendation as you can quickly change the underlying programming tools. i.e. changing from .NET to a php driven website would not need a mountain of re-directs.
I would personally always end my urls with / rather than .aspx, .htm, .php
regards
Andy
andrewkillen0726 10 months ago 4
@andrewkillen0726 Agreed. This can also extend to the non-HTML-like file types, such as images, stylesheets, scripts, and others. Rather than attempt to hard-code a mime-type in the file name (and also in the HTML in the case of style and script tags), why not let your server do it in the headers like it's supposed to? That frees you to serve up different file types to different users. For instance, src="/images/logo" could serve a .gif to ancient browers and a .png to everyone else.
mhixson1 10 months ago
@mhixson1 Not sure I would go that far as to rely on mime types for CSS and images. and definitly not for PDF exe and the like. Personally I like to let people know what they are getting before they get it with they mouse over a link. When I see something ending with a / I expect it to be a web page and nothing else.
andrewkillen0726 10 months ago
@andrewkillen0726 Sorry, I was unclear. I was thinking more about resources included within the page, not resources that appear as links. There, the file extensions are for the developers' benefit alone, so you may as well do what makes sense programatically. See the source of the WHATWG homepage for examples.
mhixson1 10 months ago
and why you don't use them in your personal blog, Matt? none of your url's end with any extensions, whatsoever
iulicush86 1 year ago 12
Snake oil
peppeddu 1 year ago
URLRewrite (I.e., IIS7) wouldn't affect Google understanding the file correct? I believe it's only the appearance of the URL in the URL Browser Line.
heliplain 2 years ago
But, what about wordpress stuff, where you can select end the url with / or add some arbitrary extension like .htm or .php
franpuga 2 years ago 3