Add bar at end of URL with Htaccess

9

I'm having a problem with my .htaccess , since I previously used .htm at the end now that I want to by bar I can not change.

Usage with .htm query string :

##### Url Dinamica ###################################
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d

# Exibe a pagina com a extensao em .htm
RewriteRule ^([A-Za-z-]+)\.htm$ index.php?tag=$1 [qsappend]

</ifModule>

I tried to use

RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
RewriteRule ^([A-Za-z-]+)\$ index.php?tag=$1/ [qsappend]

But it generates error and does not open normal

    
asked by anonymous 24.10.2015 / 21:38

1 answer

1

Try with this regex ^([A-Za-z-]+)\\.htm$ .

  

\ to check \ literal (case sensitive) and    \. to check . literal (case sensitive)

    
01.02.2017 / 20:22