PDA

View Full Version : Redirection for one domain to another



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.

etechsuppor
05-17-2021, 12:34 PM
When you redirect a URL, you're simply forwarding it to another address on the same, or different domain. You can set up a redirect that sends visitors to your new domain name when they'll try to access a URL that belonged to your old domain.

lionel54
08-26-2021, 12:00 PM
Hello.
My name is Lionel, I specialize in the creation of https://i.postimg.cc/8zpC740t/wfdghjk.png (https://ucn-digital.com/consultation-marketing/)wordpress website. I'm 36 years old and I live in Marseille. I'm an expert in the field and I would like to start with coding. In particular with php and Mysql. I hope to find the necessary resources to grow very quickly.

ailferzenf
03-02-2023, 05:10 PM
hm very good bro go enxt

david007
09-18-2024, 08:52 AM
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.

Helpful redirection code suggested to us.