I've tried several ways to remove the trailing slash from my URL in .htaccess and nothing worked but now even my URL can't be found because now it has a slash.
Here is what my .htaccess looks like. I need to get rid of so many redirects and don't have a clue how to do it. And I would like to remove the slash on my permalink on my WordPress site because it's not good SEO and now I can't even make mine work.
How do I get rid of stuff here that isn't working and get rid of slash on my URL example.com? It doesn't matter for rest because I've done a lot of work and there are a lot of trailing slashes on my site. Just want my Domain Permalink Slash gone.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)/+$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)/+$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN LSCACHE
# END LSCACHE
# BEGIN NON_LSCACHE
# END NON_LSCACHE
# BEGIN GD-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^electricridespro\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GD-SSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)/+$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)/+$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*)/+$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Of course I don't want my GD-SSL file gone but need to get the rest out of here safely and get exact code to make my Permalink example.com/ get rid of slash and make it example.com but not take the slashes off the rest that are on other URLs in my site so my site does't get broken.
electricridespro.comwithout slash and it is showing canonical aselectricridespro.com/even if I put a meta tag in head section or my Yoast plugin. it puts wrong url. Can I remove duplicate stuff in htaccess? so my site doesnt have so many redirects. Is there a code out there that takes out slash on url that you can provide me and do I add it up top or bottom? @MrWhite – Robert Gaskill Oct 30 '18 at 00:51