diff --git a/src/Entity/Redirect.php b/src/Entity/Redirect.php
index ae54ec5..72003e4 100644
--- a/src/Entity/Redirect.php
+++ b/src/Entity/Redirect.php
@@ -86,7 +86,12 @@ class Redirect extends ContentEntityBase {
    * {@inheritdoc}
    */
   public function preSave(EntityStorageInterface $storage_controller) {
-    $this->set('hash', Redirect::generateHash($this->redirect_source->path, (array) $this->redirect_source->query, $this->language()->getId()));
+    $real_path = \Drupal::service('path.alias_manager')->getPathByAlias('/' . $this->redirect_source->path);
+    if (isset($real_path) && !empty($real_path)) {
+      $path = ltrim($real_path,"/");
+    }
+    $hash = Redirect::generateHash($path, (array) $this->redirect_source->query, $this->language()->getId());
+    $this->set('hash', $hash);
   }
 
   /**
diff --git a/src/Form/RedirectForm.php b/src/Form/RedirectForm.php
index b71fe7b..376225b 100644
--- a/src/Form/RedirectForm.php
+++ b/src/Form/RedirectForm.php
@@ -113,6 +113,10 @@ class RedirectForm extends ContentEntityForm {
 
     $parsed_url = UrlHelper::parse(trim($source['path']));
     $path = isset($parsed_url['path']) ? $parsed_url['path'] : NULL;
+    $real_path = \Drupal::service('path.alias_manager')->getPathByAlias('/' . $path);
+    if (isset($real_path) && !empty($real_path)) {
+      $path = ltrim($real_path,"/");
+    }
     $query = isset($parsed_url['query']) ? $parsed_url['query'] : NULL;
     $hash = Redirect::generateHash($path, $query, $form_state->getValue('language')[0]['value']);
 
