
Suppose you want your web pages to be accessed without the trailing slash at the end of the URL. For example, instead of www.mysite.com/account/ you want the URL to show up as www.mysite.com/account – this might be for aesthetic purposes, or possible for the sake of consistency accross all your URLs. The code below will show you how to achieve this. Note that the code should go in the .htaccess file in your root folder.
The Code
1 2 3 |
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] |