Skip to content

Commit 14cd6f0

Browse files
committed
Add external URL redirects for /linkedin, /github, /x, /resume, /email
1 parent 06c6c92 commit 14cd6f0

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

404.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,23 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Page Not Found - Redirecting...</title>
77
<script>
8-
// Redirect to home page for any unknown paths
9-
window.location.replace('/');
8+
// External URL redirects
9+
const externalRedirects = {
10+
'linkedin': 'https://linkedin.com/in/osinachiokpara',
11+
'github': 'https://github.com/sin4ch',
12+
'x': 'https://x.com/sin4ch',
13+
'twitter': 'https://x.com/sin4ch',
14+
'email': 'mailto:okparaosi17@gmail.com',
15+
'resume': 'https://drive.google.com/file/d/16Zw9Vj8JVRSGUOkDNtXtd3UBYu-TIaz1/view'
16+
};
17+
18+
const path = window.location.pathname.replace(/^\//, '').toLowerCase();
19+
if (externalRedirects[path]) {
20+
window.location.replace(externalRedirects[path]);
21+
} else {
22+
// Redirect to home page for any unknown paths
23+
window.location.replace('/');
24+
}
1025
</script>
1126
</head>
1227
<body>

index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,23 @@
17791779

17801780
// Handle initial page load based on URL hash
17811781
function handleInitialRoute() {
1782+
// External URL redirects (e.g., sin4.ch/linkedin -> linkedin.com/in/osinachiokpara)
1783+
const externalRedirects = {
1784+
'linkedin': 'https://linkedin.com/in/osinachiokpara',
1785+
'github': 'https://github.com/sin4ch',
1786+
'x': 'https://x.com/sin4ch',
1787+
'twitter': 'https://x.com/sin4ch',
1788+
'email': 'mailto:okparaosi17@gmail.com',
1789+
'resume': 'https://drive.google.com/file/d/16Zw9Vj8JVRSGUOkDNtXtd3UBYu-TIaz1/view'
1790+
};
1791+
1792+
// Check if current path matches an external redirect
1793+
const path = window.location.pathname.replace(/^\//, '').toLowerCase();
1794+
if (externalRedirects[path]) {
1795+
window.location.replace(externalRedirects[path]);
1796+
return;
1797+
}
1798+
17821799
const validSections = ['about', 'projects', 'opensource', 'writing', 'talks', 'gallery', 'experience'];
17831800

17841801
// Get section from hash (e.g., #projects -> projects)

0 commit comments

Comments
 (0)