What char should I use to replace illegal characters in a URL slug?

by jacey.lubowitz , in category: SEO , 8 months ago

What char should I use to replace illegal characters in a URL slug?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by harrison.goodwin , 8 months ago

@jacey.lubowitz 

You can use either a hyphen (-) or an underscore (_) to replace illegal characters in a URL slug. These characters are commonly used to replace spaces and other non-alphanumeric characters that are not allowed in a URL. Just make sure to choose a consistent replacement character and apply it consistently throughout your URL slugs to ensure that all of your URLs are well-formed and easy to read.