Change site via .htaccess

0

I have the following urls:

www.meusite.com.br/pagina1
www.meusite.com.br/pagina1/a/b/c
www.meusite.com.br/pagina1/1/2/nome-perfil

I need to access my site, I have a redirect in htaccess to another website, with the same base, becoming:

www.meunovosite.com.br/pagina1
www.meunovosite.com.br/pagina1/a/b/c
www.meunovosite.com.br/pagina1/1/2/nome-perfil

How can I do this? I already have the following configuration in it:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

And in index.php I have:

header("Location: http://www.meunovosite.com.br");

However, if I search my site on Google, it will put the folders that belong to it, and in this case, it will be redirected only to the home of the site.

    
asked by anonymous 25.07.2016 / 16:36

1 answer

1

It would look like this using 301 redirect via htaccess :

redirect 301 /pagina1 http://meunovosite.com.br/pagina1
redirect 301 /pagina1/a/b/c http://meusite.com.br/pagina1/a/b/c
redirect 301 /pagina1/1/2/nome-perfil http://meunovosite.com.br/pagina1/1/2/nome-perfil

Help

    
25.07.2016 / 16:44