From e671530a2e6399cd7b21ce477d60ed44b3560a6e Mon Sep 17 00:00:00 2001
From: Helen Chong <119173961+helenclx@users.noreply.github.com>
Date: Tue, 10 Dec 2024 18:49:49 +0800
Subject: [PATCH] Correct email decoy URL redirect
---
src/.htaccess.njk | 2 +-
src/_data/sitemeta.js | 3 ++-
src/_includes/global/footer.njk | 2 +-
src/index.njk | 2 +-
src/slashes/navbarlinks/about.md | 2 +-
5 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/.htaccess.njk b/src/.htaccess.njk
index 8095e7df..6f9d6c84 100644
--- a/src/.htaccess.njk
+++ b/src/.htaccess.njk
@@ -15,7 +15,7 @@ Header set Cache-Control "no-cache, public"
RewriteEngine on
# Redirect obfuscated email links to mailto link
-RewriteRule ^/email/$ mailto:{{ sitemeta.siteAuthor.email }} [R=301,L]
+RewriteRule ^.*{{ sitemeta.siteAuthor.emailDecoyUrl }}.*$ mailto:{{ sitemeta.siteAuthor.email }} [R=301,L]
# Block bad bots
RewriteCond %{HTTP_USER_AGENT} ({{ robots.htaccess }}) [NC]
diff --git a/src/_data/sitemeta.js b/src/_data/sitemeta.js
index 70a5d1f4..843012ac 100644
--- a/src/_data/sitemeta.js
+++ b/src/_data/sitemeta.js
@@ -5,7 +5,8 @@ export const siteAuthor = {
name: "Leilukin",
email: "contact@leilukin.com",
emailEncoded: 'contact@leilukin.example.com',
- url: siteUrl + "/about"
+ emailDecoyUrl: "/mail/",
+ url: siteUrl + "/about/"
};
export const siteLanguage = "en";
export const siteLocale = "en_MY";
diff --git a/src/_includes/global/footer.njk b/src/_includes/global/footer.njk
index 60ebfa11..2792e680 100644
--- a/src/_includes/global/footer.njk
+++ b/src/_includes/global/footer.njk
@@ -1,7 +1,7 @@