You must use the flag [R=301]
or [R=302]
only to indicate the type of direction.
In the case if 301 is a permanent redirect, if 302 then is temporary redirect.
On the website meusite.com.br
you must create in the root folder a . htaccess with the following content:
RewriteRule ^home1\.html$ http://novosite.com.br [R=301]
RewriteRule ^home2\.html$ http://novosite.com.br [R=301]
RewriteRule ^home3\.html$ http://novosite.com.br [R=301]
RewriteRule ^home4\.html$ http://novosite.com.br [R=301]
RewriteRule ^home5\.html$ http://novosite.com.br [R=301]
RewriteRule ^home6\.html$ http://novosite.com.br [R=301]
If the paths of the urls on the new site are the same as the old one, you should do so:
RewriteRule ^home1\.html$ http://novosite.com.br/$0 [R=301]
RewriteRule ^home2\.html$ http://novosite.com.br/$0 [R=301]
RewriteRule ^home3\.html$ http://novosite.com.br/$0 [R=301]
RewriteRule ^home4\.html$ http://novosite.com.br/$0 [R=301]
RewriteRule ^home5\.html$ http://novosite.com.br/$0 [R=301]
RewriteRule ^home6\.html$ http://novosite.com.br/$0 [R=301]
The $0
already identifies the url path because of regex
If all urls have this default home1.html to home20.html, you can simplify to:
RewriteRule ^home(\d+)\.html$ http://novosite.com.br/$0 [R=301]
the \d+
represents "any number", so it will recognize home1.html or home10001.html for example.
You can change [R=301]
for [R=302]
should the redirect be temporary and in the future return to the old site.
Note that you may also want to use the flag [QSA]
chance want to direct urls with querystring, for example if access meusite.com.br/home1.html?foo=a
it should redirect to novosite.com.br/home1.html
with . htaccess
But if you use the flag [QSA]
then the redirect will look like this novosite.com.br/home1.html?foo=a
For this use thus:
RewriteRule ^home(\d+)\.html$ http://novosite.com.br/$0 [QSA,R=301]