SEO Friendly URLs with no trailing slash

By Dave - October 19, 2016

Thanks Tim, 

We'll look into this.  

So to be clear, what the plugin does by default is currently to generate links with trailing slashes, but you want no trailing slashes.  And, you want any other URLs that aren't the officially generated one to redirect to the officially generated URL.  Is that right?

And would it work if it did that but WITH trailing slashes, or do you have as a requirement no trailing slashes? 

Let me know, thanks!

Dave Edis - Senior Developer
interactivetools.com

Hi Dave,

I don't think it's an issue with the plugin since it makes both URLs (with and without the slash) available. I think that is a good thing for users. Just for search engines it would be good to enforce a standard for one or the other just like you do for www or non-www enforcement. 

I was able to get the desired result of no trailing slash using the following code in the .htaccess file above the "force www. prefix code"

### Remove trailing slash
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]