HTML and CSS Reference
In-Depth Information
Uniform Resource Locator (URL)
Scheme name
(protocol)
Domain
name
http://www.example.com
Prefix
(World Wide Web
subdomain)
Top-level domain
(TLD)
Figure 4-1. The domain within the URL
The tree of subdomains can contain a maximum of 127 levels. Each label may contain up to 63 characters.
According to RFC 2181, the full length of a domain name is 253 characters.
Conventional domain names cannot contain Latin alphabet-based characters with diacritics, non-Latin
characters, or scripts. With the introduction of Internationalized Domain Names (IDN), it is possible to represent
names and words in several languages in native alphabets and scripts.
Domain names should be thought over before they are registered. They should be easy to remember and easy to
spell [61]. There are also SEO considerations. While the name of a person generally remains the same over the years,
a product or technology name can change. For example, the owner of a DVD store has probably changed from DVD
sales to Blu-ray sales with the beginning of the HD era. However, the domain name containing the word DVD still
represents the old technology. If the word movie or films would have been used, the domain name would not have
become obsolete. Finding an appropriate domain name, which is still free and contains popular keywords, can be a
real challenge, though.
No WWW
Although the www subdomain is very common on the Web, some webmasters consider it outdated or inappropriate
[62]. Similar to mail servers that do not use the request@mail.example.com format, web servers can allow access to
web pages though the main domain.
On Apache servers, the www. can be removed from the URIs within the domain by adding the code in Listing 4-11
to the .htaccess file. Its name stands for hypertext access. This file provides directory-level access control that can be
used for authorization, authentication, redirection, blocking, customized error response, and cache control.
Listing 4-11. Removing www. from URIs with .htaccess Configuration
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
This code makes it unnecessary to remove the www. from every hyperlink of the web site one by one. However,
a large share of webmasters disagrees with removing the www. from URIs [63]. According to their reasoning, www. is a
reminder that the World Wide Web (WWW) is just one of the many services on the Internet.
 
Search WWH ::




Custom Search