Skip to content

Commit

Permalink
Automatically remove www from URL on Quick Start page so web based fl…
Browse files Browse the repository at this point in the history
…asher works properly.
  • Loading branch information
VanceVagell committed Dec 23, 2024
1 parent d5f9a0d commit 0df17c8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions website-src/quick_start.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<title>Quickstart - kv4p HT</title>
<link rel="icon" type="image/x-icon" href="img/favicon-16x16.png">

<script>
// Check if the current hostname starts with "www.", if so redirect to remove it (it breaks the web-based firmware flasher library).
if (window.location.hostname.startsWith("www.")) {
const newHostname = window.location.hostname.slice(4);
const newURL = `${window.location.protocol}//${newHostname}${window.location.pathname}${window.location.search}`;
window.location.replace(newURL); // Use replace to avoid adding the redirect to the history
}
</script>

<!-- kv4p HT is an open source project, I'm not selling anything or showing ads. I use Google Analytics only to understand how people are using the website. - KV4P -->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-485V3MK16Y"></script>
Expand Down

0 comments on commit 0df17c8

Please sign in to comment.