websites urls without file extension?

后端 未结 10 1676
误落风尘
误落风尘 2020-12-16 14:50

When I look at Amazon.com and I see their URL for pages, it does not have .htm, .html or .php at the end of the URL.

It is lik

相关标签:
10条回答
  • 2020-12-16 15:23

    Traditionally the file extension represents the file that is being served.

    For example

    http://someserver/somepath/image.jpg

    Later that same approach was used to allow a script process the parameter

    http://somerverser/somepath/script.php?param=1234&other=7890

    In this case the file was a php script that process the "request" and presented a dinamically created file.

    Nowadays, the applications are much more complex than that ( namely amazon that you metioned )

    Then there is no a single script that handles the request ( but a much more complex app wit several files/methods/functions/object etc ) , and the url is more like the entry point for a web application ( it may have an script behind but that another thing ) so now web apps like amazon, and yes stackoverflow don't show an file in the URL but anything comming is processed by the app in the server side.

    websites urls without file extension?

    Here I questions represents the webapp and 322747 the parameter

    I hope this little explanation helps you to understand better all the other answers.

    0 讨论(0)
  • 2020-12-16 15:28

    Well how about a having an index.html file in the directory and then you type the path into the browser? I see that my Firefox and IE7 both put the trailing slash in automatically, I don't have to type it. This is more suited to people like me that do not think every single url on earth should invoke php, perl, cgi and 10,000 other applications just in order to sent a few kilobytes of data.

    0 讨论(0)
  • 2020-12-16 15:28

    A number of posts have mentioned this, and I'll weigh in. It absolutely is a URL rewriting system, and a number of platforms have ways to implement this.

    I've worked for a few larger ecommerce sites, and it is now a very important part of the web presence, and offers a number of advantages.

    I would recommend taking the technology you want to work with, and researching samples of the URL rewriting mechanism for that platform. For .NET, for example, there google 'asp.net url rewriting' or use an add-on framework like MVC, which does this functionality out of the box.

    0 讨论(0)
  • 2020-12-16 15:30

    In Django (a web application framework for python), you design the URLs yourself, independent of any file name, or even any path on the server for that matter.

    You just say something like "I want /news/<number>/ urls to be handled by this function"

    0 讨论(0)
提交回复
热议问题