URl - DOC - DOC by liwenting

VIEWS: 11 PAGES: 5

									The four parts of a                                                                                      This presentation is on URLs. URL sounds
URL                                                                                                      exotic – it stands for universal resource locator
                           URLs – uniform resource locators
                                                                                                         – but it is just a geek term for a Web address. A
                      IT skills: compose URLs                                                            URL is the address of a resource on the Web.
                      IT concepts: parts of a URL, shortened URLs,
                      domain names, directories, file names
                                                                                                         You’ve typed URLs into Web browsers many
                                                                                                         times, but may not have thought about the
                                                                                                         meanings of each of the four parts of a URL.
                                                                                                         We will review them and also mention
                             This work is licensed under a Creative Commons Attribution-Noncommercial-
                             Share Alike 3.0 License.
                                                                                                         shortened URLs.

                                                                                                         In order to understand the parts of a URL, we
                                                                                                         will also cover domain names, directories and
                                                                                                         file names.




Communication                                                                                            URLs are a technical topic, but understanding
                                     Where does this topic fit?                                          them will also help you use the Web, so we
technology
                                   • Internet concepts
                                                                                                         include this presentation at two places in our
                                      – Applications                                                     class outline.
                                      – Implications
                                      – Technology
                                   • Internet skills
                                      – Application development
                                      – Content creation
                                      – User skills




URL – a Web                                                                                              To retrieve a page from a Web site, you type its
                              URL, uniform resource locator
address                                                                                                  URL into the box at the top of the browser and
                                                                                                         hit enter. The browser then retrieves the page
                          http://som.csudh.edu/fac/lpress/shortbio.htm
                                                                                                         from the server and displays it. URL is just a
                                                                                                         fancy way to say the Web address of the page.
                                                              request

                                                                                                         In this example, a short professional biography
                                                                page
                          Client                                                             Server      that is stored at the listed URL is retrieved and
                                                                                                         displayed.
The four parts of a                                                  If you look at URLs, you see that they can be
URl                           Four parts of the URL                  broken down into four parts. Note that some of
                                                                     the parts may be omitted at times – we’ll talk
                                                                     about that later. For now, let’s take a look at
                      http://som.csudh.edu/fac/lpress/shortbio.htm   each of the four parts.
                      http://som.csudh.edu/fac/lpress/shortbio.htm
                      http://som.csudh.edu/fac/lpress/shortbio.htm
                      http://som.csudh.edu/fac/lpress/shortbio.htm




Part 1 – this is a                                                   The URL prefix “http://” indicates that this is
Web page                                 http://                     the locator for a Web document that should be
                                                                     retrieved and displayed. It turns out that Web
                                                                     browsers can also function as clients for other
                      http://som.csudh.edu/fac/lpress/shortbio.htm   services like file transfer, but that is seldom
                                                                     done. For that reason, one can often omit the
                                                                     “http://” since most browsers will plug it in for
                                                                     you.




Part 2 – the domain                                                  The next part of our example URL reads
name of the server              The domain name                      “som.csudh.edu”. That is the domain name of
                                                                     the server. Domain name is another fancy geek
                                                                     word – it is the name of the computer the server
                                                                     program is running on. We will say more about
                      http://som.csudh.edu/fac/lpress/shortbio.htm
                                                                     domain names in another presentation. For
                                                                     now, it’s enough to say that the domain name
                                                                     identifies a unique computer on the Internet.
Part 3 – the                                                                              The next part of the URL is the directory or
                                                 The directory
directory the page is                                                                     folder containing the page we are looking for.
in on the server              http://som.csudh.edu/fac/lpress/shortbio.htm
                                                                                          Every computer has many files in storage. We
                                                                                          would quickly become confused in trying to
                                                        root                              locate a single file in a list of say 100,000
                                                                                          names. For that reason, we organize our storage
                                     staff              fac               admin           into hierarchical directories, sub-directories,
                                                                                          sub-sub-directories and so forth.
                                 * lpress          jsmith      ...        jdoe

                                                                                          Here we have three sub-directories – for staff,
                                                                                          faculty and administrators. Since I am a faculty
                                                                                          member, my directory, named “lpress,” is a
                                                                                          subdirectory of the fac directory. Each faculty
                                                                                          member – jsmith, jdoe, and the rest would have
                                                                                          directories in the fac directory.



Part 4 – the name of                                                                      The final part of the URL is the name of the file
                                                 The file name
the file on the server                                                                    we wish to retrieve, in this case “shortbio.htm.”
                              http://som.csudh.edu/fac/lpress/shortbio.htm                Since shortbio.htm is in the lpress directory, the
                                                                                          Web server will send that file back to the client,
                                                        root
                                                                                          which will display it. The user can then read
                                                                                          my short biography.
                                     staff              fac               admin


                                                                                          Note that the file name has two parts separated
                                                               ...
                                     lpress        jsmith                 jdoe
                                                                                          by a dot. The suffix or “extension” indicates
                                                                                          what type of file it is. The suffix “htm” means
                                  shortbio.htm



                                                                                          that this is an HTML file, in other words a Web
                                                                                          page. (We will say more about HTML later).




Shortened URLs                                                                            Let’s look at a couple more things concerning
                                      URLs may be shortened                               URLs.
                         http://www.csudh.edu/studentaffairs/financialaid/faq.
                         shtml#apply_for_scholarships                                     For a start, you can save space by shortening a
                                                                                          URL. If you try them out, you will see that both
                         http://bit.ly/djeREW                                             of the links shown here are to the same page.
                                                                                          There are many URL shortening services on the
                                                                                          Internet. I used one called bit.ly to create this
                         (I shortened the URL using the service at http://bit.ly. There
                                                                                          example.
                         are others that do the same thing.)
Shortened URLs can                                                                    Be cautious when clicking on shortened URLs.
be risky.             Know the source of a shortened URL
                                                                                      Shortened URLs hide the actual domain name,
                                                                                      so you cannot tell where they link to by looking
                                                                                      at them.
                                         http://bit.ly/9dLHk5

                                                                                      Click the link shown here to see why you
                                                                                      should only go to shortened URLs from trusted
                                                                                      sources.




Most Web clients                                                                      As mentioned previously, if you delete the
assume http:// by               You can delete the http://                            http://, the client will assume the message is for
default                                                                               a Web server and request the page as if the
                                                                                      http:// had been included.
                             som.csudh.edu/fac/lpress/shortbio.htm




Default file names                                                                    If you delete the file name, the Web server will
                             You can delete the file name                             look for a file with a default name, which is
                                                                                      specified by the server administrator.
                              http://bpastudio.csudh.edu/fac/lpress/
                                                                                      Traditional default names are index.htm,
                                                                                      Index.html, default.htm, and default.html.
                     The Web server will look for a file with a default name, which
                     is specified by the server administrator.

                     Traditional default names are index.htm, Index.html,
                     default.htm, and default.html.
Summary                                                                                             Here we summarize the meaning of the four
                                                URL summary
                                                                                                    parts of a URL. In addition to learning about
                                                                                                    the parts of a URL, we saw that they may be
                            http://som.csudh.edu/fac/lpress/shortbio.htm
                                                                                                    shortened using a service like Bit.ly and that
                            This request is for a Web (http) server                                 some parts of the URL were optional.
                            The server program is running on a computer with the domain
                            name som.csudh.edu
                            Look in a subdirectory called fac/lpress
                            If there is a file called shortbio.htm, send it back to the client to
                                                                                                    We also learned about domain names,
                            be displayed; if not, send an error message back to the client          directories and file names.

                            Domain name = the unique name of a computer on the Internet




Self-study questions
                       1. Without looking back, can you describe the four parts of a URL
                          and explain what each means?

                       2. What happens if you misspell the file name in a URL?

                       3. What happens if you misspell the domain name in a URL?

                       4. Can you omit the domain name?

                       5. What happens if a URL shortening service like bit.ly goes out
                          of business?

								
To top