Remove trailing slash using .htaccess in WordPress

Juan Manuel Zolezzi Volpi picture Juan Manuel Zolezzi Volpi · Dec 19, 2011 · Viewed 18k times · Source

I'm looking for a way to remove trailing slash for all WordPress URL's.

I found similar answers like this one but it doesn't work when there's WordPress .htaccess rules before.

Here is my current WordPress .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Answer

Frankey picture Frankey · Nov 15, 2016

It might be as simple as go to settings > permalinks in the wp admin and remove the trailing slash at the input box for custom structure