Rules

Secret ingredients to quality software

Do you use dashes in your URLs?

Last updated by Tiago Ara├║jo [SSW] on 26 Mar 2021 12:25 am (8 months ago) See History

For maximum readability and SEO use kebab-case (dashes) in your URLs.

Learn more on Best Practices for URL Structure.

northwind.com/pageonworddocumentation

Figure: Bad example - No kebab-case in URL

northwind.com/PageOnWordDocumentation

Figure: Bad example - PascalCase (better readability and still works in small caps, but other people might share it without the MixedCase)

northwind.com/page on word documentation

...will become

northwind.com/page20%on20%word20%documentation

Figure: Bad example - spaces it will show up in your URL structure as 20%, which is bad for readability and SEO

northwind.com/page_on_word_documentation

Figure: OK example - underscored (snake_case) URLs have good readability but are not recommended by Google

northwind.com/page-on-word-documentation

Figure: Good example - kebab-case is recommended by Google. Note: Don't use any uppercase

Not for domains! This is only for pages and documents. Domains are bad when they have dashes in them.

Read more on SEO 101: Hyphens vs. Underscores in URLs.


More info

You can install the IIS URL Rewrite Module for IIS7 you can make ugly URL's much more friendly.

friendly url rule
Figure: Rewrite both the HTML in the page and the incoming URL's to be friendly

The caveat here is that it will only work if the URL is in the clear on the page.

Note: This could only be done with certain links as others are postbacks as well.

Adam CoganAdam Cogan
Tiago AraujoTiago Araujo

We open source. Powered by GitHub