Time redirection

Asked

Viewed 48 times

2

I have an application that I need to change domain

app.com.br

need to change to

app2.com.br

however while I do not change the dns I need a temporary redirect

I need that when someone enters any path of the app.com.br I direct to it but in the second domain

for example

app.com.br/path/teste -> app2.com.br/path/teste  

I can do by placing a header in index.php, but if someone enters a path directly without going through the index php they are not redirected.

how can I solve this?

1 answer

1

The .htaccess must be at the root of your domain app.com.br :

RewriteEngine On
RewriteBase /
#Para todos os requestes para www.app.com.br
RewriteCond %{HTTP_HOST} ^www\.app\.com\.br$
#Redireciona para app2.com.br
RewriteRule (.*) http://www.app2.com.br/$1 [R=301,L]

Browser other questions tagged

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