Put bar at the end of the url with .htaccess

3

I need to add a forward slash (/) to the end of the url using .htaccess.

My current .htaccess looks like this:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^dominio.com.br [NC]
RewriteRule ^(.*)$ http://www.dominio.com.br/$1 [L,R=301]
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^([a-z0-9-]+)/?$ /$1.html [NC]
</IfModule>

Does anyone know how to do this?

    
asked by anonymous 19.02.2016 / 15:16

2 answers

2

Live,

In my case I use this way:

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

Hugs;)

    
19.02.2016 / 15:21
0

Resolved? If not, I use it like this:

RewriteBase /
RewriteCond %{REQUEST_URI} /+[^.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
    
06.10.2016 / 15:50