Learn to Find the URL of a Web Page -- Understand This Important Aspect of Websites

If you've been designing and developing websites for many years, you many have forgotten some of the challenges that newer web professionals face when they are first breaking into this industry. One of these challenges is how hard it can sometimes be to figure out where a web page is going to show up once it’s uploaded to the Web.  If you have put your new website online and you’re having trouble finding it, don’t feel bad - you’re not alone.

Let's take a look at how a URL works so you can better understand this important aspect of websites.

How a URL Works

The first thing you should understand is how a URL, or Uniform Resource Locator, actually works. Sometimes referred to as a "website address", a URL is basically an address that connects to a resource (in this case a web page) on the Internet. Just like a phone number will connect you to a specific person when dialed, a URL will connect you to a specific place on the Internet. Similarly, just like everyone's phone number must be unique in order to connect you to the right person, so too must a URL be unique in order to bring you to the correct website.

The Parts of a URL

There are specific parts of a URL, each of which performs a different function. Here is an example of a URL
http://www.website-name.com/samples/portfolio.html
The parts of this URL are:
  • The Domain
    http://www.website-name.com
    This is the part of the URL that you would register and pay for the right to use for a specified period of time.  The domain name you choose is likely based on your company name of whatever you want to use for your website address.

    The domain name can be broken down into two pieces - the Protocol Identifier in this example is "http" and the Resource Name, which is what you register, is "website-name.com".  
  • A Directory
    /samples/
    Many websites place all their files in what is called the "root" directory, which is the initial directory or folder on a website. Additional directories can be added as needed. For instance, most websites create a directory named "images" where all the image files for a site would be placed.This helps keep the files for a site organized.
  • The file name
    portfolio.html
    This is the actual name of the file that you uploaded from your hard drive. In this example, the file name is "portfolio.html". It consists of the file name (portfolio) and the file extension (.html).  

Figuring Out the URL of a Page You Just Uploaded

In order to figure out the URL of a page you just uploaded you need to know the following:
  • Your domain
  • The directory you uploaded it to
  • The name of the file you want to see
If you’re sure you have all that information correct, and the web page is not appearing in your browser window, there are a few things you should check before re-uploading the page:
  • Watch out for upper and lower case in the file name and directories. Many hosting providers use UNIX or Linux, which are case-sensitive. This means that a file that is uploaded as page3.html is not going to be the same as page3.HTML.As a best practice, I suggest always naming your files with lowercase letters. If you follow that syntax at all times, you will never have to worry about whether or not a file or extension was written with capitals or lowercase letters.
  • Check the file extension. Windows tends to save web pages as .htm rather than .html. But if you type file3.html in the URL, the server won’t find it, because the extension is only three letters instead of four. Again, I suggest you choose standard and stick to it. I always use .html\ for my pages to avoid any confusion.
  • Check that you uploaded it to the right location. The most common reason for a file not showing up is because it got uploaded to the wrong directory. Check the directories that are near to the one you wanted to upload to in the file manager you use to add files to your hosting environment. Also check the directory right above the one you wanted. You might discover that the file is on your server just not in place you intended it to be.

Default URLs

There is a special convention for URLs that don’t have a file name listed. For example:
http://webdesign.about.com/
In order to create a URL like that, your web server will need to show whatever the default file for your site is. In most cases, this is the index.html page. You should put an index.html page in every directory on your web server.
You upload an index.html file in the same way as any other web page file, but these pages can be accessed by two different URLs.
For example, these two URLs would point to the same place:
http://www.hosting-provider.com/jennkyrnin/samples/
http://www.hosting-provider.com/jennkyrnin/samples/index.html
In the first example, the index.html page is shown because that is the default and no other page was specified. In the second example, that page is actually the one listed in the URL.

After You’ve Determined the Page’s URL

Once you’ve figured out what the URL is for the page, you should test to make sure that it shows up in a web browser. If it doesn’t, use my test suggestions above to troubleshoot the issue. If you still can’t find the page, you should contact your hosting provider’s support department to have them help you determine what may be happening in this instance.
Original article by Jennifer Krynin. Edited by Jeremy Girard on 1/4/17.

Source :thoughtco.com

No comments