diff --git a/public/API/newComment.php b/public/API/newComment.php
index 1d63270193b2a0e7e4c15e0fba5d8d3a274805d6..ab8d29800c3352b30c90f4d5c9da5b87e42a4320 100644
--- a/public/API/newComment.php
+++ b/public/API/newComment.php
@@ -30,7 +30,7 @@ if($responseData->success) {
     $sql = "INSERT INTO comments (name, email, comment, article) VALUES ('$name', '$email', '$comment', '$article')";
 
     if ($conn->query($sql) === TRUE) {
-        header("Location: $ref");
+        header("Location: " . $_SERVER["HTTP_REFERER"]);
     } else {
         echo "Error: " . $sql . "<br>" . $conn->error;
     }