Website redirecting to url with / at the end

Asked

Viewed 25 times

0

When I enter my site www.exemplo.com

It redirects to www.exemplo.com/

How to solve this?

Follow my . haccess

Options -Indexes

#Ativamos a RewriteEngine
RewriteEngine on

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(www\.)?idealnutri\.com$ [NC]
RewriteRule ^.*$ https://www.idealnutri.com%{REQUEST_URI} [R,L]

RewriteRule ^sitemap\.xml$ gera_xml.php [L] 
RewriteRule ^noticia/([^/]*)\.html$ /noticia.php?link=$1 [L]

1 answer

-1

I have the impression that the problem is the moment you force the HTTPS

Try it this way:

RewriteCond %{HTTP_HOST} ^(www\.)(.+) [OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)
RewriteRule ^ https://%2%{REQUEST_URI} [R=301,L]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.