Redirect to new domain with .htaccess

Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress.

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question

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.

It should go to

Note: The new domain is without www.

Can anyone help me how to implement this?

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 4 years ago.

Improve this question

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/page1

It should go to

https://newdomain/page1

Note: The new domain is without www.

Can anyone help me how to implement this?

Share Improve this question edited May 21, 2020 at 9:03 fuxia 107k38 gold badges255 silver badges459 bronze badges asked May 21, 2020 at 6:11 Nirmal KUmarNirmal KUmar 11 silver badge2 bronze badges 1
  • Have you tried anything? Is newdomain currently pointing to the same place as www.oldomain? – MrWhite Commented May 21, 2020 at 9:04
Add a comment  | 

1 Answer 1

Reset to default 1
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.oldomain [NC]
RewriteRule ^(.*)$ http://newdomain/$1 [L,R=301]

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742413755a4439333.html

相关推荐

  • Redirect to new domain with .htaccess

    Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress.

    9小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信