Answers.Body: <p>I solved like this, maybe any of you will use with different types of it.</p>
  
  <pre><code>craft()-&gt;on('entries.onBeforeSaveEntry', function(Event $event) {
    $entry = $event-&gt;params['entry'];
    $turkishCharacters = ['ı', 'ü', 'ö', 'ş', 'ç', 'ğ'];
    $englishCharacters = ['i', 'u', 'o', 's', 'c', 'g'];
  
    $entrySlug = $entry-&gt;slug;
    $entrySlug = str_replace($turkishCharacters, $englishCharacters, $entrySlug);     
    $entry-&gt;slug = $entrySlug;
  });
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-24T14:55:53.200Z
Answers.LastActivityDate: 2019-05-24T14:55:53.200Z
Answers.UserDisplayName: Berk Can Demir
Body: <p>I need to replace some characters in my entry's URI because we have some letters which do not exist in English like "ş" or "ç". It is a problem for SEO and we have to change each time manually. I tried something with <code>entries.onBeforeSaveEntry</code> but I couldn't solve the problem. I'm confused with getting URI and set the new URI. Any suggestion?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-23T10:58:13.860Z
Comments.Text: I think you may have to use the "After save entry" event to change a URI.
Comments.UserDisplayName: JMKelley
Tags: <plugin-development><craft2>
Title: Changing some letters in entry's uri before save it
ThreadText: # Changing some letters in entry's uri before save it
  
  (Asked by: username_0 on 2019-05-22)
  
  I need to replace some characters in my entry's URI because we have some letters which do not exist in English like "ş" or "ç". It is a problem for SEO and we have to change each time manually. I tried something with `entries.onBeforeSaveEntry` but I couldn't solve the problem. I'm confused with getting URI and set the new URI. Any suggestion?
  
  **Tags:** plugin-development, craft2
  
  > **Comments:**
  > **username_1**: I think you may have to use the "After save entry" event to change a URI.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-05-24. Score: 1
  
  I solved like this, maybe any of you will use with different types of it.
  
  ```
  craft()->on('entries.onBeforeSaveEntry', function(Event $event) {
    $entry = $event->params['entry'];
    $turkishCharacters = ['ı', 'ü', 'ö', 'ş', 'ç', 'ğ'];
    $englishCharacters = ['i', 'u', 'o', 's', 'c', 'g'];
  
    $entrySlug = $entry->slug;
    $entrySlug = str_replace($turkishCharacters, $englishCharacters, $entrySlug);     
    $entry->slug = $entrySlug;
  });
  
  ```
  
  
  ---
  
  