slightly confused about all of these redirect codes. So I have a website that has been live on
I have recently duplicated the site, but need to move it to a new domain
However, if people still visit the first domain, I need them to be redirected to the new domain. However, I do not want to lose the SEO I have on the original domain.
I have seen that I could do a 301 or 303 redirect, although not sure what my best option is? At the moment, within .htaccess I have added
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^https://domainA.com/subfolder/[NC,OR]
RewriteCond %{HTTP_HOST} ^https://domainA.com/subfolder/ [NC]
RewriteRule ^(.*)$ https://domainB.com/subfolder/$1 [L,R=301,NC]
</IfModule>
This does not seem to do anything at the moment though.
Am I missing something?
Thanks
2
Answers
I think you’d better work on Apache configuration file /etc/apache2/sites-available/your-site.conf
This should work please report feedback
Regarding your question. Google advices 301 redirects so I think that is better keep it that way
Different subfoder