0

I am changing the domain of my website.

But, I am struggling with the domain redirection. I need to implement this wildcard redirection.

So that I visit.

https://www.oldomain.com/page1

It should go to

https://newdomain.com/page1

Note: The new domain is without www.

Can anyone help me how to implement this?

  • Have you tried anything? Is newdomain.com currently pointing to the same place as www.oldomain.com? – MrWhite May 21 at 9:04
1
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.oldomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.