<h2>Orijinal metin:</h2>
<p id="metin"></p>
<h2>Slugify_URL:</h2>
<p id="adres"></p>
h2 {
  font-size: medium;
}
#metin {
  color: red;
}
#adres {
  color: green;
}
h2,
p {
  width: 360px;
  max-width: 100%;
}
body {
  display: inline-flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 300px;
  width: 100%;
  margin: 0 auto;
}
function Slugify_URL(text) {
  var trMap = {
    çÇ: "c",
    ğĞ: "g",
    şŞ: "s",
    üÜ: "u",
    ıİ: "i",
    öÖ: "o"
  };
  for (var key in trMap) {
    text = text.replace(new RegExp("[" + key + "]", "g"), trMap[key]);
  }
  return text
    .normalize("NFD")
    .trim()
    .replace(/\s/gi, "-")
    .replace(/[^\w\-]+/g, "")
    .toLowerCase();
}

var metin = "Gerçeği konuşmaktan korkmayınız.";
var adres = Slugify_URL(metin);
console.log("uRl: " + metin);
console.log("adres: " + adres);

document.getElementById("metin").innerHTML = metin;
document.getElementById("adres").innerHTML = adres;
Run Pen

External CSS

  1. https://codepen.io/wolkanca/pen/wvgOPWb

External JavaScript

  1. https://codepen.io/wolkanca/pen/wvgOPWb