Skip to content
Nazmul Nikhil
Menu

Double Slash in URL (Ahrefs): Fix the Link That Creates It

Ahrefs flags URLs with a double slash in the path, like /blog//post/. They can create duplicate pages. Here's what causes them and how to fix it.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
Double Slash in URL (Ahrefs): Fix the Link That Creates It
Photo: Christian Wiediger on Unsplash

In short

Ahrefs flags "Double slash in URL" for URLs with two slashes in a row in the path (not the // after https:). They usually come from joining a base URL ending in / with a path starting with /. Many servers return the same page for both versions, creating duplicates. Fix the template or link that builds the URL, and add a canonical or redirect to the clean version.

A stray slash looks harmless, but servers often treat /blog//post/ and /blog/post/ as two different URLs serving the same page.

Typical cause

const base = 'https://example.com/';
const path = '/blog/post/';
const url = base + path; // https://example.com//blog/post/

The fix is to join URLs with a helper that handles slashes, for example new URL(path, base).href in JavaScript.

How to fix it

  1. Find where the flagged URLs are linked (incoming links in Ahrefs).

  2. Fix the template, menu or setting that produced them, such as a site URL saved with a trailing slash and a path that starts with one.

  3. Make sure each page has a canonical tag pointing to the clean URL.

  4. Optionally, add a server rule that 301 redirects any double-slash path to the single-slash version.

WordPress: check menu links, the Site Address setting, and theme code that builds URLs with home_url() plus a leading slash.

Shopify, Webflow and Wix: usually caused by hand-typed links in content or custom code.

Custom builds: fix the URL-joining helper once, and every link is fixed.

This guide isn't affiliated with or endorsed by Ahrefs.

Sources and references

TAGSAhrefs Site AuditDouble slash in urlDouble slash url seo// in url
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Technical SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Site Audit Issues posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com