Handle Trailing slashes at the end of URL <p>There is clear cut advantage of using consistent URL structure for wordpress website. </p> <p>I want all of my URL's to end with / (the homepage and internal page URL's). Let me give an example website which is handling it very efficiently so that the URL's without ending with slash or ending with multiple slashes are 301 redirected to URL with single slash.</p> <p><code>http://viralpatel.net/blogs</code> 301 redirect to viralpatel.net/blogs/</p> <p><code>http://viralpatel.net/blogs//</code> 301 redirect to viralpatel.net/blogs/</p> <p><code>http://viralpatel.net/blogs/</code> 200 OK</p> <p><code>http://viralpatel.net/blogs/check-string-is-valid-date-java</code> 301 redirect to <code>http://viralpatel.net/blogs/check-string-is-valid-date-java/</code></p> <p><code>http://viralpatel.net/blogs/check-string-is-valid-date-java//</code> 301 redirect to <code>http://viralpatel.net/blogs/check-string-is-valid-date-java/</code></p> <p><code>http://viralpatel.net/blogs/check-string-is-valid-date-java/</code> 200 OK</p> <p>Any idea what .htaccess rules can help achieve this. My current .htaccess looks like:</p> <pre><code> RewriteEngine On RewriteCond %{HTTP_HOST} ^javaexperience.com [NC] RewriteRule ^(.*)$ http://www.javaexperience.com/$1 [R=301,L] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </code></pre>