Question

Locked

What is the difference between <pc-name> and <pc-name>.<domain-name>?

By file.sharing.1007 ·
Hi,

Can anyone give advice? I am not familiar with networking stuff.

Currently I am having problem with the url of website...
If url name is just using <pc-name>(e.g. http://<pc-name>/test/default.aspx), the links in web page will work perfectly fine. But, if url name is using <pc-name>.<domain-name>(e.g. http://<pc-name>.<domain-name>/test/default.aspx), some of the links which need javascript functions are not working.
But, if the scenario above is tested on other pc, it works perfectly fine. If the scenario above is tested on the pc itself(i.e. the pc whose name is <pc-name>), it will have the error mentioned above.

Really appreciate if anyone can give advice on this. Thanks in advanced!

Rgds,
Grace83f

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

This may give you a better understanding

by Jacky Howe In reply to What is the difference be ...

How to Name and Organize Your Website's URLs
One of the main challenges confronting web developers is how to name web pages. Ultimately, naming web pages will depend on the website's architecture (the way individual pages are organized within the site).

Each web page must have one unique address: its URL or Uniform Resource Locator. A URL can be a domain name followed by its extension (for example http://www.accordmarketing.com ), a sub-directory (for example http://www.accordmarketing.com/tid/ ) or a file (for example http://www.accordmarketing.com/tid/newsletter.html ).

Find out if your domain is available:

.com .us .net .org .biz .info .ws


When a visitor types your domain name, he/she will be directed to a file named "http://www.yourdomain.com/index.html". The letters following the dot to the right of the word "index" indicate the implementation technology used to create the page. For example .html refers to a page created in HTML. Similarly, .pdf will refer to a page created in Adobe Acrobat, .xls to a page in Excel, etc..

Web browsers are designed to automatically default to the index page when a domain name is entered, so usually the words "index.html" will not be visible in the browser's address bar.

Domain names can contain up to 63 characters, limited to letters, numbers and hyphens. It doesn't matter if the letters are capitalized or not. For example "yourdomain.com", "YourDomain.com" or "YOURDOMAIN.COM" will all take visitors to your home page.

Depending on how large and complex your website is, you may want to create sub-directories. If you have an informational site where you publish articles, you may want to have a "yourdomain.com/archive" sub-directory where you can place past articles. Also, companies use sub-directories to designate sub-sites, for example, CNN's International sub-site: cnn.com/CNNI , or GM's Chevrolet Malibu sub-site: chevrolet.com/malibu.

Strictly speaking, the last character of a sub-directory's URL should be a slash (/), however, browsers will include it by default, so it is not necessary to type it in the address bar (although it is recommended to do so on web pages' HTML code).

Sub-directories, like domain names, default to an index page, so you must make sure that you create one. Otherwise, when somebody types a sub-directory name, they will get a white, unbranded page with just a list of links to the pages saved under that sub-directory.

For example, if you have an article archive in a sub-directory called "yourdomain.com/articles/" , you must create the following page: "yourdomain.com/articles/index.html" (assuming that the page is created in HTML). In this page you can place, among other things, links to your various articles ( for example: "yourdomain.com/articles/article1.html", "yourdomain.com/articles/article2.html", etc.).

If you don't want to create sub-directories, you can put all your files in the root directory (immediately under your domain name). If you do so, but still want to have a way to relate your pages to a certain section of your website, you can employ the technique of using the "underscore" character to divide the file name in two, for example: "yourdomain.com/articles_article1.html", "yourdomain.com/articles_article2.html", etc..

That way, your article files will be in the root directory, while, at the same time, they will clearly be marked as articles.

One thing to keep in mind is that, contrary to domain names, sub-directories and file names ARE case sensitive, meaning that if one of your pages is named "yourdomain.com/articles_article1.html", you will get an error message if you look for "yourdomain.com/ARTICLES_Article1.html".

A good rule of thumb is to limit the length of your URLs to around 60 characters. This is recommended because some email programs still use Text format, meaning that for web links to work they must be written in full form (for example: "http://www.domain.com/subdirectory/page.html"). If somebody emails a link to one of your URLs, and it is more than 60 lines long, the email program could split it in two lines and the link may not work.

Finally, a word of caution in case you decide to change your website's architecture in the future (for example, to include sub-directories): it is better not to change the URL of an existing page. However, if you change it, use a redirection script to guide users to the new URL. This is very important, since many users will access your site through a search engine (where old URLs may still be indexed) or through links on other pages. The last thing you want is to lose those visitors to a 404 Error page.


--------------------------------------------------------------------------------

You can freely reprint this article provided that you include the following resource box:

Mario Sanchez is a Miami based freelance writer who focuses on Internet marketing and web design topics. He publishes The Internet Digest ( http://www.theinternetdigest.net ), a growing collection of web design and Internet marketing articles, tips and resources. You can freely reprint his weekly articles in your website, ezine, or ebook.


http://www.theinternetdigest.net/archive/url-naming-tips.html

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums