Redirecting via htacess

Asked

Viewed 36 times

1

Guys, how do I redirect a site http://www.meuSite.com.br for https://meuSite.com.br using the .htacess. On the provider I am he created a . htacess this way

#DO NOT REMOVE THIS LINE AND THE LINES BELOW SSL_REDIRECT:meuSite.com.br
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^meuSite.com.br$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE SSL_REDIRECT:meuSite.com.br

I’m a little lost, and I don’t really understand how this works. Could someone help me?

I have SSL Active, and I don’t know if it has anything to do with it.

1 answer

0


RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://seusitecomhttps.com.br/$1 [R,L]
  • It worked! Thank you very much, but these "parameters [R,L] what it means?

  • R|redirect S|Skip http://httpd.apache.org/docs/current/rewrite/flags.html

  • @Andrefirmo Tip: use R=301. Recommended reading: Redirection (in English)

Browser other questions tagged

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