php - 301 redirect for a WordPress site and subfolder to different domains -


i have 2 wordpress installation example abc.com , abc.com/new/

now planning move site own domain, i.e abc.com >> xyz.com , abc.com/new/ >> klm.com.

so wondering how accomplish using .htaccess , should have redirect .htaccess?

inside root .htaccess have redirect rule first rule:

rewriteengine on  rewritecond %{http_host} ^(?:www\.)?abc\.com$ [nc] rewriterule ^ http://xyz-site.com%{request_uri} [r=301,l,ne] 

then inside /new/.htaccess have redirect rule first rule:

rewriteengine on  rewritecond %{http_host} ^(?:www\.)?abc\.com$ [nc] rewriterule .* http://klm-site.com/$0 [r=301,l,ne] 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -