<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gokul</title>
    <description>The latest articles on DEV Community by Gokul (@gokul_0411).</description>
    <link>https://dev.to/gokul_0411</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4278464%2F92179215-2a95-4332-b8ae-509d79a05a55.png</url>
      <title>DEV Community: Gokul</title>
      <link>https://dev.to/gokul_0411</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gokul_0411"/>
    <language>en</language>
    <item>
      <title>How I Fixed 888 Trailing-Slash Redirects on Astro + Cloudflare Pages</title>
      <dc:creator>Gokul</dc:creator>
      <pubDate>Wed, 02 Dec 2026 12:19:46 +0000</pubDate>
      <link>https://dev.to/gokul_0411/how-i-fixed-888-trailing-slash-redirects-on-astro-cloudflare-pages-41fg</link>
      <guid>https://dev.to/gokul_0411/how-i-fixed-888-trailing-slash-redirects-on-astro-cloudflare-pages-41fg</guid>
      <description>&lt;p&gt;While auditing my new static site &lt;strong&gt;&lt;a href="https://onlineheightcalculator.com/" rel="noopener noreferrer"&gt;Online Height Calculator&lt;/a&gt;&lt;/strong&gt; (6,300+ pages in 9 languages built with Astro), I noticed 888 pages stuck in &lt;em&gt;"Page with redirect"&lt;/em&gt; in Google Search Console.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Root Cause:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Astro generated directory index files (&lt;code&gt;dist/height-calculator/index.html&lt;/code&gt;), while my canonicals and sitemaps used clean URLs without trailing slashes (&lt;code&gt;/height-calculator&lt;/code&gt;). On Cloudflare Pages, requesting &lt;code&gt;/height-calculator&lt;/code&gt; triggers a &lt;code&gt;308 Permanent Redirect&lt;/code&gt; to &lt;code&gt;/height-calculator/&lt;/code&gt;, creating a canonical mismatch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjxdfoaxj5ffno24wc86y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjxdfoaxj5ffno24wc86y.png" alt=" " width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix (Zero Config Rewrite Needed):&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Instead of refactoring all canonicals, sitemaps, and 70+ tests to &lt;code&gt;trailingSlash: 'always'&lt;/code&gt;, I added a small post-build Node script (&lt;code&gt;generate-clean-urls.mjs&lt;/code&gt;) that hardlinks &lt;code&gt;dist/path/index.html&lt;/code&gt; to &lt;code&gt;dist/path.html&lt;/code&gt; in ~3 seconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Result:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Cloudflare Pages now serves &lt;code&gt;https://onlineheightcalculator.com/height-calculator&lt;/code&gt; (and our &lt;a href="https://onlineheightcalculator.com/height-comparison" rel="noopener noreferrer"&gt;visual height comparison tool&lt;/a&gt;) directly with &lt;strong&gt;&lt;code&gt;200 OK&lt;/code&gt; and 0 redirects&lt;/strong&gt; — matching our sitemaps and canonicals cleanly!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7kp7vb9z0leiy3aepdrh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7kp7vb9z0leiy3aepdrh.png" alt=" " width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>astro</category>
      <category>seo</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
