Rewrite Url from VietnameseString for Web Application (WebPage, MVC, .Net Core, .Net Framework)
Project site:
baoduong-dev / VietnameseUrlRewrite
Rewrite Friendly-Url from VietnameseString for Web Application (WebPage, MVC, .Net Core, .Net Framework)
Using:
UrlWrite.Url(string);
Example:
public IActionResult Index()
{
string a = "Đây là Url bài viết số n";
string b = UrlWrite.Url(a);
return Content(b);
/// Result: "day-la-url-bai-viet-so-n"
}
How do I use it?
- Install "VietnameseUrlRewrite" via NuGet
Install-Package VietnameseUrlRewrite -Version 1.0.1
2, In your controller code or Razor page, call UrlWrite.Url(string) if you want to convert string to url.
Using .Net Standard 2.0
Use .net Standard should be suitable for all projects .Net Framework and .Net Core
Authors
- Bảo Dương - Initial work - baoduong-dev
License
Licensed under the MIT License.
Top comments (2)
What's the main motivation to using this?
I guess some words in the URL lose meaning, however it becomes easier to type.
I assumed that the Vietnamese characters were valid in the URL specification.
Vietnamese has accents for letters. You need to remove it, make it Latin, and be Google-friendly