Generation of URL segment for content



When a page is created an URL is auto-generated that changes ø to o. Is there any way to change this behaviour so that ø becomes oe?

Thanks in advance.


Jan 14, 2019 14:50
webtoolsoffers - Jul 15, 2019 12:14
I am also facing this type of problem on my website Webtoolsoffers and I resolve this problem through this post.
josef305 - May 20, 2020 11:06
Valuable post HostGator Coupon Code 75% off content. You have given outstanding information about sites.I am searching forward for your next accommodating substance.

Hi Benjamin,

I'd probably go with implementing a custom IUrlSegmentGenerator, one that still uses the default functionality:

internal class CustomUrlSegmentGenerator : IUrlSegmentGenerator
    private readonly IUrlSegmentGenerator _urlSegmentGenerator;

    public CustomUrlSegmentGenerator(IUrlSegmentGenerator urlSegmentGenerator)
        _urlSegmentGenerator = urlSegmentGenerator;

    public string Create(string proposedSegment, UrlSegmentOptions options)
        // Replace ø whilst maintaining case of the original
        proposedSegment = Regex.Replace(proposedSegment, "ø", match => char.IsUpper(match.Value[0]) ? "OE" : "oe", RegexOptions.IgnoreCase);

        return _urlSegmentGenerator.Create(proposedSegment, options);

    public bool IsValid(string segment, UrlSegmentOptions options)
        return _urlSegmentGenerator.IsValid(segment, options);

and the initialization module:

public class UrlSegmentGeneratorInitializer : IConfigurableModule
    public void ConfigureContainer(ServiceConfigurationContext context)
            (locator, defaultUrlSegmentGenerator) => new CustomUrlSegmentGenerator(defaultUrlSegmentGenerator));
    public void Initialize(InitializationEngine context) { }
    public void Uninitialize(InitializationEngine context) { }
Jan 14, 2019 16:49

@Aniket: As far as I can see doesn't your code do something entriely different?

It wouldn't make any difference to the default segment for a page, but would it fact mean that if the user entered the URL:


it would try to route it to:


Jan 14, 2019 17:14

Hi Jake,

You are right. I misread the question. Deleting my comment to avoid confusion.


Jan 14, 2019 17:17

Thank you for your answers!

Jan 15, 2019 12:23

Thanks Jake, this helped me with a similar situation, replacing double hypens from generated urls.

while (proposedSegment.Contains("--"))
    proposedSegment = proposedSegment.Replace("--", "-");
Jul 05, 2019 17:45
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.