1

RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*[^/])$ /$1/ [L,R=301]

When I'm using this to adding slash at the end it is redirecting like example.com//

But I want to redirect my url

 www.example.com 

to

 www.example.com/

Can any one suggest me how to do this?

user3264805
  • 27
  • 2
  • 8

1 Answers1

0

Have you tried searching the forum?

RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]

Source: .htaccess Rewrite to Force Trailing Slash at the end

More questions:

Htaccess: add/remove trailing slash from URL

Add Trailing Slash .htaccess

.htaccess if url not ends with extension, add slash at the end

Community
  • 1
  • 1
Jacob
  • 1,933
  • 2
  • 20
  • 30
  • `RewriteBase / RewriteCond %{index.php} !-f RewriteCond %{HTTP_HOST} !index.php RewriteCond %{HTTP_HOST} !(.*)/$ RewriteRule ^[^/]*$ http://%{HTTP_HOST}/$1/ [L,R=301]` when im using this I'm getting two slashes at the end of url, but i just need only one slash, can u suggest me? – user3264805 May 22 '15 at 06:47