Pay securely at PayPal. On the confirmation page, click Continue to product download page to download this product immediately.
Having a PayPal account is optional; if you don't want to sign up, look for the link which says Don't have a PayPal account?
Friendly URL Writer
Overview
Convert plain text to machine- and human-friendly URLs.
Live Demo
Try it out yourself by entering some text and seeing what it looks like in URL format.
Why use friendly URLs?
It is widely recognised that when building websites, having URLs which are built from words describing the contents of a page, rather than having an obscure identification number is an important aspect of web design. This generally improves rankings in search engines for your page, and makes it friendlier for your users, for example when people copy and paste a URL into an email.
| Unfriendly URL | ![]() |
|---|---|
| Friendly URL | ![]() |
The Friendly URL Writer simply converts text into a format suitable for use in a URL, and can be used with any URL rewriting software you use, for example ASP.NET rewriting or ASP.NET MVC URL routing. This is especially useful in cases where you want to use user-inputted text, such as a product name or username, as part of a URL. By feeding any text through the Friendly URL Writer, you can be confident that the resulting text will be a valid, search-engine-friendly, human-readable URL.
Features
- Removes illegal characters from an arbitrary input string, making it usable in a URL.
- Improves website search engine rankings.
- Enforce a maximum length on your URLs - very useful when making your URLs Twitter-friendly.
- European characters are converted to URL-safe version, for example 'é', 'ê', and 'ë' are all converted to 'e'.
- Chinese Pinyin characters have tone marks removed, e.g. "ní hǎo" is converted to "ni_hao".
- Default text can be specified when an input string contains only illegal characters.
Code Example
The following shows how a username can be converted into a string that can be used as a URL.
C#
string user = "Dr. Ëvîl!"; IUrlWriter urlWriter = new UrlWriter(); urlWriter.MaximumLength = 100; string url = "/users/" + urlWriter.ToUrlString(user);
VB
Dim user As String = "Dr. Ëvîl!" Dim urlWriter As IUrlWriter = New UrlWriter() urlWriter.MaximumLength = 100 Dim url As String = "/users/" & urlWriter.ToUrlString(user)
The url variable now contains the string "/users/Dr_Evil". The following table shows
further examples of inputs and the output produced by the Friendly URL Writer.
| Input | URL Writer settings | Output |
|---|---|---|
| /Music/The Beatles / Oh! Darling | Default settings | /Music/The_Beatles/Oh_Darling |
| !!!hello there!!! | IUrlWriter.SpaceCharacter = '+' | hello+there |
| Everybody's got something to hide except me & my monkey | IUrlWriter.MaximumLength = 41 | something_to_hide_except_me_and_my_monkey |



