开发者

What are common file extensions for web programming languages?

开发者 https://www.devze.com 2022-12-09 20:22 出处:网络
What file extensions are used most commonly by different languages? Please don\'t put source file names (like .java) but rather extensions that would be present in a URL for rendered pages.

What file extensions are used most commonly by different languages? Please don't put source file names (like .java) but rather extensions that would be present in a URL for rendered pages.

Here is my (alphabetized) list so far

  • ASP Classic
  • asp
  • ASP.NET
  • aspx
  • axd
  • asx
  • asmx
  • ashx
  • CSS
  • css
  • Coldfusion
  • cfm
  • Erlang
  • yaws
  • Flash
  • swf
  • HTML
  • html
  • htm
  • xhtml
  • jhtml
  • Java
  • jsp
  • jspx
  • wss
  • do
  • action
  • JavaScript
  • js
  • Perl
  • pl
  • PHP
  • php
  • php4
  • php3
  • phtml
  • Python
  • py
  • Ruby
  • rb
  • rhtml
  • SSI
  • shtml
  • TS
  • XML
  • xml
  • rss
  • svg
  • Other (C, perl etc.)
  • cgi
  • dll

Any more? I'll keep updating this b开发者_Go百科ased on comments. Largest correct additions (or deletions) is the accepted answer.

Aside: This is for comparing language use online: http://blog.paulisageek.com/2009/10/file-extensions-on-internet.html


Keep in mind that good URL design will completely hide any underlying file types.


I have created a Github gist that contains a list of programming languages and their extensions, here is a subset of the data included in the gist file:

{
  "name":"CoffeeScript",
  "type":"programming",
  "extensions":[
     ".coffee",
     "._coffee",
     ".cake",
     ".cjsx",
     ".cson",
     ".iced"
   ]
  },{
  "name":"ColdFusion",
  "type":"programming",
  "extensions":[
     ".cfm",
     ".cfml"
  ]}

I hope it is helpful.

languages.json.


  • .action — struts2

  • .do — struts1

  • .xml — XML

  • .rss — RSS feeds

  • .atom — Atom feeds(RSS)

(no extension) -- used now a days to increase readability of the URL, check stackoverflow URL


Ruby also tended to use .rhtml in the past.

Stellent uses the .hcsp extension for its page templates.

I believe Django uses .dtl.


.yaws (Erlang Yaws Web Server)


Here is an extension you forgot:

  • .adpAOLServer using TCL


Ruby on Rails also uses the following internally for templates (files that are mostly HTML or JavaScript). So they're not really public facing, and are transparent to the end user/robot.

  • .html.erb
  • .erb
  • .rjs

Used to be that most CGI scripts were written in Perl.


IE specific strangeness:

  • .hta — html application
  • .htc — html components, allows you to alter IE behavior at runtime, from you website!

Also XML:

  • .svg — it's not just an image format!


.js, .html, .htm, .xhtml probably deserve a nod.


-SSI (Server Side Includes), use the extension .shtml


Add there:

  • ASP.NET
    • .axd
    • .asx
    • .asmx
    • .ashx
    • .aspx


.aspx .asp .css


REBOL tends to use .r

But .cgi is also used by some for REBOL CGI scripts.


ASP.NET needs a couple more, but I'm not sure this is exhaustive:

  • aspx
  • ascx
  • asmx (web services)


Here's a few of the commonly-used (but rarely enforced) extensions for some CSS dialects:

  • .hss for hss style sheets
  • .sass for sass style sheets
  • .less for less css style sheets
  • .ccss or .pcss for clever css style sheets


Going old school: .cgi

Typically written in C or Perl


.java .cs and .i_am_kidding_i_read_the_question.

On the serious side, swf (Flash) get hidden by the JS that loads them, generally, but they are extensions usually seen by the client. This is a limit case because it's not like JPEG (doesn't allow for web programming) nor like Javascript. But then, neither is PHP/ASP/JSP because from the client side it's just markup :)


  • .cs ----> C#
  • .kt ----> Kotlin


.json has become popular as a data xfer format

.png .jpg .gif are the most common graphics, but there are others.

Also video extensions

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号