Tag Archives: .htaccess

How to remove (redirect) trailing slashes from URLs using .htaccess

Created at: December 22, 2015; Last update: February 19, 2016

Well… I see a lot of questions regarding SEO friendly URLs, and also regarding the problem with URLs that have trailing slashes which show the same content as the URLs without trailing slashes. Although I really hope that the search engines are smarter than treating those URLs as duplicate content, I feel there is the need to know how to redirect them to the non-trailing slashes URLs.

So here it is. You open .htaccess, and you should have in it the following:

This should work for anything, not just CodeIgniter. Hope this helps…