kumkum
05-15-2021, 04:43 PM
You can use below code to redirect your website's page individually.
Redirect 301 /oldpage.html http://www.domainname.com/newpage.html
ReRedirect 301 /oldpage.html http://www.domainname.com/newpage.html
Redirect 301 /oldpage2.html http://www.domainname.com/folder/ direct 301 /oldpage2.html
If you want to redirect whole website then use below code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomainname.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomainname.com [NC]
RewriteRule ^(.*)$ http://newdomainname.com/$1 [L,R=301,NC]
You can check Website Redirection (https://hoststud.com/resources/htaccess-301-redirect.198/) details easily in this link.
Redirect 301 /oldpage.html http://www.domainname.com/newpage.html
ReRedirect 301 /oldpage.html http://www.domainname.com/newpage.html
Redirect 301 /oldpage2.html http://www.domainname.com/folder/ direct 301 /oldpage2.html
If you want to redirect whole website then use below code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomainname.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomainname.com [NC]
RewriteRule ^(.*)$ http://newdomainname.com/$1 [L,R=301,NC]
You can check Website Redirection (https://hoststud.com/resources/htaccess-301-redirect.198/) details easily in this link.