1
I have a domain like this: https://www.dominio.com
, that always has to access this way.
So I need to do some redirects. These are the ones:
Of:
(http) www.dominio.com.br
(http) www.dominio.com
https://www.dominio.com.br
To:
https://www.dominio.com
What I’ve done so far:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?dominio\.com$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^(www\.)?dominio\.com\.br$ [NC]
RewriteRule ^(.*)$ https://dominio\.com/%{REQUEST_URI} [L,R=301]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
The only problem is this:
But it doesn’t redirect when I type https://www.dominio.com.br
.
It wouldn’t just be fixating on dominance.?
RewriteRule ^(.*)$ https://www.dominio.com/$1 [L,R=301]
– Don't Panic
It didn’t work. The problem is when I type
https://www.dominio.com.br.
, it does not redirect and gives that security error page. Why it has no certificate in that domain.– Diego Souza
both domains are yours? if you do not own the
.com
he will not point to your service.– Guilherme Lautert
They’re both mine, the
.com
and the.com.br
. They are redirected to the IP of my server.– Diego Souza