admin管理员组

文章数量:1122846

I am using wordpress with woocommerce and I just got a new domain and I have already migrated the old website to the new domain. My issue is am trying to redirect any one who visited any content on the old domain to the same content on the new domain.

The reason so that if a client visited the old path from an old link he would be redirected to the new domain but not the homepage.

I have tried some htaccess codes but they just redirect the client to new domain homepage.

Thanks

I am using wordpress with woocommerce and I just got a new domain and I have already migrated the old website to the new domain. My issue is am trying to redirect any one who visited any content on the old domain to the same content on the new domain.

The reason so that if a client visited the old path from an old link he would be redirected to the new domain but not the homepage.

I have tried some htaccess codes but they just redirect the client to new domain homepage.

Thanks

Share Improve this question edited May 7, 2024 at 15:25 Najm Aldekhel asked May 7, 2024 at 10:13 Najm AldekhelNajm Aldekhel 32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomin\.com
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
</IfModule>

This is what you're looking for, before the WP block in your .htaccess.

本文标签: pluginsRedirect OLDPath to NEWURLPath