Why does url allow multiple slashes?

why does the url: https://dominickdesigns.space//legal/ allow multiple slashes in the URL name?

even if you add infinite # of slashes: https://dominickdesigns.space/////////legal/ it still renders the same page.

shouldn’t it show 404 page instead?

I contacted my hosting provider about this and they said it could be something to do with Total CMS.

I have paused cloudflare on the site so I don’t think it has to do with any page rule on cloudflare.

It has nothing to do with Total CMS or CloudFlare.

The URI portion of the URL (URL less protocol and domain) maps to a file location. On Unix/Linux having multiple separators in a row has no special meaning. So if you don’t have any rewrite rules that rely on having a single slash /, the webserver will serve the page.

You can’t have extra slashes in the protocol (https) or at the end of the URI.

Technically, HTTP RFC 2396 defines path separator to be a single slash, but Apache resolves the extras fine as long as it’s not at the end or in the protocol.

Thanks for the reply. I don’t think I understand what is being said.

interestingly, if I don’t add a trailing slash to the url like this: https://dominickdesigns.space/////legal

then it resolves and removes all extra slashes AND adds the trailing slash. I can’t figure out how this is happening.

Not sure an easy way to explain it, but a URL consists of many parts.

  • You have the transfer protocol (https: or http: are the most used) followed by two slashes //
  • You have the Domain name that can contain multiple parts followed by a separator /:
    • A Subdomain (www., help., test.)
    • The Main domain name (apple, realmac, etc.)
    • The top-level domain name (.com, .net, .edu, .org, etc.)
    • An optional country code
  • After the domain name and before it’s trailing slash you can have an optional port number preceded by a :.
  • After the domain name (and port) you then might have a file path (about/founder/, products/widgets/, etc.)
  • The last part of the path is usually the file name (index.html, index.php, mypage.html), If the file name isn’t complete the webserver may look for default file names (DirectoryIndex) in a specified order (aka tidy links).
  • After the file path/name you can optionally have a query string following a ?.

Now that should give you an idea of the anatomy of a URL. The web browser and web servers job are to serve pages. So they will try and fix common errors in entering a URL. For example in the old days of the mid-'90s, you had type-in the URL including protocol. You had to type in http:// or https:// on every single page.

Modern browsers and servers will attempt to “fix” poorly entered URL’s. So If you omit the http:// the browser will fix that for you. If you have entered a /// instead of a single / in the path the server will remove the extra slashes. Why because there can’t be directories with no names. And a trailing slash means nothing.

3 Likes

@ben does this have to do with Rapidweaver? I can not figure out why there are // on some pages and not on others. Has this been an issue in the past? I paused cloudflare and issue remained so I don’t think it’s cloudflare. I contacted my hosting company again and they mentioned it has to do with Total CMS but I don’t see how. They refused to assist further because it is something to do with my web dev program.

does it have anything to do with the setting where Rapidweaver generates social media tags?

When I look at the source of https://dominickdesigns.space//legal/ and I use the search function to find //legal I see that the two results are:

<meta name="twitter:url" content="https://dominickdesigns.space//legal/index.php">

<meta property="og:url" content="https://dominickdesigns.space//legal/index.php">

I am not sure if this is coming from the setting in Rapidweaver or from @joeworkman SEO help stack?

It’s not SEO Helper. If you are using SEO Helper, you should be disabling the meta tags from RW.

Anyways, I am pretty sure that I filed this bug with RW white some time ago. @tpbradley is the right person to ping about this.

thank you for replying @joeworkman ! I wanted to confirm: should I use a unique seo helper stack on each page? I currently have seo helper in the same partial as my site styles (which is on every page). But it makes sense that a unique one should be on each page.

just got a response to my chat from the devs - they are investigating.

In the meantime I will put a unique SEO helper on each page.

  • I unmarked the option in Rapidweaver General to generate social tags
  • I added unique seo helper to each page

issue remains.

https://dominickdesigns.space//free-seo-audit/ (with two slashes)
is same as
https://dominickdesigns.space/free-seo-audit/ (with one slashe)

Who are you chatting with? What problem are they investigating? I’m not seeing a issue.

Are you talking about the extra slash in the URL or the extra slash in the SEO helper or the extra slash in the Rapidweaver Social meta tags?

If you are talking about the extra slash in the URL it has nothing to do with RapidWeaver:

iPhone - Apple is the same as iPhone - Apple, and it resolves to the same as iPhone - Apple. Apple dot com is not a rapidweaver site. Modern browsers and servers will attempt to “fix” poorly entered URL.

If you are talking about an extra slash with the Rapidweaver Social meta tags

What version of RapidWeaver are you running? I’m running the latest Version 8.6.2 (20836) and can’t get the extra / to appear in the <meta property="og:url" or <meta name="twitter:url" no matter what I try.

If you are talking about SEO helper

I don’t have it to test, but it appears on Vital Tech Results - Improving User Experience With Automated Triggers you are using it. The double slash in the <meta property="og:url" isn’t there, even with the // in the URL?


I get the same when I test with the RapidWeaver Social Meta tags.

oh! Maybe it is resolved. Previously there were 2 slashes in the meta data values when viewing page source.

turns out I had a typo in raw html menu! I had manually typed a link. Duh! :face_with_head_bandage::persevere:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.