[ad_1]
How to add/remove the trailing slashes in URLs using the .htaccess?
You can use the below code in the .htaccess file depending on the trailing slash required or not –
No trailing slash
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
Trailing slash
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule [^/]$ %{REQUEST_URI}/ [L,R]
Also Read
Powered by WHMCompleteSolution
[ad_2]