0

I Have this code on my .htaccess, buy when I access www.site.com.br/contato redirect to home https://site.com.br I need all page redirect to same page with HTTPS without WWW.

This htaccess file must do the following:

1 - Rewrite www to non-www

2 - Rewrite http to https

3 - Preserve URI strings (the url part on your site)

Sample www.site.com.br/contato go to https://site.com.br/contato

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^.*$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?cod=$1
RewriteRule ^/painel - [L,NC]
RewriteRule ^/pesquisa - [L,NC]

0 Answers0