SEO friendly URLs are URLs that work well for both visitors and search engines. URLs in general describe the location of a document or page for visitors and search engines. Well chosen URLs are vital to good SEO performance. Use “friendly”, persistent URLs throughout your application.
A “friendly” URL provides a clear description of a resource. For example, the following URL clearly describes the page the user would access:
# GOOD PRACTICE
In contrast, the following URL is more cryptic:
# BAD PRACTICE
“Friendly” URLs are more accessible to both the users visiting the URLs as well as search engine crawlers attempting to index your website. Use the following recommendations to create friendly URLs:
- Don’t include file extensions (e.g.,
.html) in the URL
- Avoid cryptic numbers and identifiers (e.g.,
- Use dashes/hyphens instead of underscores or spaces (Google does not recognize an underscore as a separator)
- Ensure that the text of the URL describes resource being accessed via the URL
- Avoid query strings
A persistent URL indefinitely directs a user to a particular web page.
It’s important to maintain persistent URLs as users may have bookmarked a page from your website or another website may be linking to your website. If you “break” this URL by moving or removing the page to which the URL points, you create a poor experience for the user.
If a URL must change, be sure to redirect users who visit the existing URL. If a resource has been permanently moved, respond with the “301” HTTP status code:
HTTP/1.1 301 Moved Permanently
If a resource has only been temporarily moved, respond with a “307” HTTP status code (or “302” for HTTP 1.0):
HTTP/1.1 307 Temporary Redirect