-
URL design is something that is often overlooked in Web design. In fact, URL is very important. It is not only the only path to a web page, but also involves whether your site is clean and friendly. This article describes the URL, a common Web element, which contains a lot of knowledge, guidelines and best practices that should not be ignored. It should be noted that W3C recommends using URI instead of URL.
Some guidelines about URLs
A URL must uniquely and permanently represent an online object
The most basic mission of a URL is to uniquely represent an object on the Internet. The URL must match one-to-one with the object on the Internet. However, in reality, this is difficult to achieve. We can often reach the same page through multiple URLs, such as http://mysite.com/PRoduct/tv and http://mysite.com/product?name=tv . This This situation is common in modern CMS. Regarding this problem, SEO moz has a good article about how to use the Canonical URL mechanism to solve the problem of duplicate URLs in the site.
The URL should be permanent, which requires you to plan the URL very carefully before the site goes online. If one day you have to change the URL, be sure to use the HTTP 301 mechanism to tell browsers and search engines that the object represented by your URL has been moved to a new address. This mechanism can ensure that the PR obtained by your old address will not is cleared.
Be as user friendly as possible
This is fundamental to URL design, your URLs should be designed with the end user in mind. A good way to keep your URL friendly is to keep it as short as possible while still being readable. For example, /about is better than /about-acme-corp-page. Of course, keeping it short cannot sacrifice readability. Addresses such as /13d2 are short, but not friendly. If you want to share your URL on social media networks such as Twitter and Facebook, you can use a URL shortening tool such as Bit.ly, but the shortened URL generated by this tool is not friendly. In a CMS such as WordPress, you can Use a controlled URL shortening plugin like PrettyLink Pro or the Short URL plugin.
When designing URLs, avoid using content that is meaningless to users, such as database ID numbers. URL addresses such as /products/23 are extremely unfriendly to users. Addresses such as /products/ballpoint-pen should be used.
maintain consistency
All URLs within the site must maintain a consistent format and structure, which can provide users with a sense of trust. If you must change the URL format and structure, you need to use the HTTP 301 mechanism.
Predictable URLs
This is also a manifestation of URL consistency. If your URL has good consistency, users can guess the URL of other content based on the URL. If /events/2010/01 points to the schedule content of January 2010, then
1. /events/2009/01 should point to the January 2009 schedule.
2. /events/2010 should point to the schedule for the whole year of 2010.
3. /events/2010/01/21 should point to the schedule of January 21, 2010.
Keywords in the URL
The URL should contain keywords of the key content of this page, such as /posts/2010/07/02/trip-best-buy-memory-cards. URLs themselves are responses to the content of the page. Including key content keywords in the URL can also improve SEO performance. A very important principle of SEO is to include content keywords in the URL address.
Technical details about URLs:
The URL should not contain suffixes such as .html, aspx, cfm
This type of information is meaningless to the end user, but takes up extra space. An exception is special addresses such as .atom, .rss, and .json, which have special meanings. Translator's Note: In some virtual host-style Web servers, this approach may not be realistic.
URL should not contain WWW part
The WWW part doesn't make any sense, is an extra burden, and is unfriendly. You can use the HTTP 301 mechanism to direct www.domain.com to domain.com.