301 redirect to remove a trailing slash?

Slightly tricky SEO + 301 redirect question here.

Before moving to Webflow, my main pages were always named index.php, sitting inside a directory. So when people would link to these pages, they would use a URL like this:

mysite.com/monkeys/

(Because this is what appears in the address bar.)

Since moving to webflow I have set my pages up like this:

mysite.com/monkeys

If someone visits the old URL structure they are automatically redirected to the new URL structure. I haven’t had to set up a 301 redirect to make that work. I’m assuming Webflow removes the trailing slash automatically.

Question is: How? Is it being 301 redirected to the no-slash version?

One of my pages that has held a #1 SEO ranking for years and years and years has suddenly dropped a number of positions, and one of my theories is that the great many links I had pointing to that page are suddenly pointing to a non-existent page.

I have attempted to set up a 301 redirect from /monkeys/ to /monkeys, but since /monkeys/ is a directory on my webflow site, it’s not letting me do that.

I’ve also attempted to escape that trailing slash, and set up a 301 redirect from /monkeys%/ to /monkeys, but when the redirect is accepted by webflow, that trailing slash is not showing up in the redirect.

So to reiterate my meandering questions:

  1. How is a page with a trailing slash redirected to a non-slash version of the page in the backend? Is that a 301 redirect?

  2. Is it possible for me to 301 redirect a page with a trailing slash to a page without a trailing slash, when that page with the trailing slash is the same name as a directory on my site?

1 Like

I am having the same issue.

Did you get an answer?

I rebuilt an entire site for a client in webflow.

The old site has a trailing backslash and the new site on webflow does not.

I want to make sure I don’t loose any SEO

A little disappointing that this was never answered. As someone considering a switch to Webflow, unanswered questions like these are concerning.

1 Like

Is it possible to get an answer to this question? I think it is relevant for many potential customers who would like to switch to webflow. Thank you!

1 Like

Personal update, since I started this thread:

I still don’t know the answer, but it’s been about a year and a half since I made the switch, and there wasn’t any lingering impact on this site’s rankings that I’m aware of.

It was such a non-event that I moved all my other sites over to Webflow too.

Thank you very much for your answer. I am afraid of loosing my very good google ranking. I am currently using Squarespace. All sites are currently available with and without the trailing slashes at the end of the url, but the canonical link of every site is using the version with the trailing slash. What is your opinion? Should I move to webflow? A loose of my ranking would be horrible as it runs my whole business. Thanks in advance for you help! My website is www.klavierstunde-muenchen.de

My opinion is that moving to Webflow is no worse (and probably better) from an SEO perspective than having your content available at both yoursite/webpage AND yoursite/webpage/ == even with canonical tags in place.

My rankings did a little wibble wobble when I shifted, but it might have been unrelated, and it corrected itself pretty quickly.

Any answer on this question? I would like to know this too…

Was there ever an update here? I am suspecting that this is more of an issue than is let on (especially if using folders in webflow?)

Agree! It should have been addressed already.

#Remove Trailing Slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]

Add this code to the .htaccess file. I hope it will fix your issue.
I was also facing the same issue for my site Mobile app development company and I fixed it.

How do I get rid of trailing slash?

Use the String. replace() method to remove a trailing slash from a string, e.g. str. replace(//+$/, ‘’) . The replace method will remove the trailing slash from the string by replacing it with an empty string.

Yes, Webflow redirects non-matching directory paths, as pretty much all webservers do. Yes, it’s a 301 redirect. You can see that easily in dev tools if you watch the networks tab.

No, that 301 redirect does not hurt your pagerank SEO, not since Google’s changes in 2016. Even prior to that point, the penalty was about 15%, and temporary until Google re-indexed your site- which is the whole point of a 301 permanent redirect.

By the way, in Webflow, all directory paths ( except root / ) are non-matching, because Webflow’s path-resolution approach doesn’t have a concept of default files.

You can create a Webflow Page called /about and you can also create a Webflow Folder called /about. Let’s say you put a Page called us in that folder. You now have three possible paths;

  • /about ← Page
  • /about/ ← Folder, but in Webflow the slug is just about.
  • /about/us ← Page

If you then make a request to /about/ it won’t match us because you didn’t specify it. It will 301 redirect to /about and match that Page instead.