Forwarding of domains

Asked

Viewed 33 times

-2

I’m having trouble setting up the redirect Htaccess 301 for a domain.

The main domain is the https://www.webfreela.com

I need the combinations below to be directed to the main:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{HTTP_HOST} ^webfreela.com$ [NC]
    RewriteRule (.*) https://www.webfreela.com/$1 [L,R=301]
</IfModule>

I thank everyone who can help me.

2 answers

1

Hello, good night!

So colleague, I believe with mod_rewrite, the correct form would be like this:

RewriteEngine on
    RewriteCond %{HTTP_HOST} ^dominioantigo.com.br$ [OR]
    RewriteCond %{HTTP_HOST} ^www.dominioantigo.com.br$
    RewriteRule ^(.*)$ https://www.webfreela.com/$1 [R=301,L]
  • Hello Wagner, thank you. The only domain that did not redirect was the https://webfreela.com.br and https://www.webfreela.com.br that has https need to add something?

0

Can be without using mod_rewrite?

<VirtualHost *:80>
    ServerName  webfreela.com
    Redirect    301 /   https://www.webfreela.com/
</VirtualHost>

(repeat this block for each alternate domain that should be redirected to www.webfreela.com. Urls with HTTPS must exchange port 443 by 80 and have configured digital certificate.)

  • Hello, it has to be mod_rewrite.

Browser other questions tagged

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