0

I have WordPress multisite. I want to redirect it to new domain. How I do it?

redirect .old.com to .new.net

Thanks for respone ;)

*I have copy all file and database from old.com to new.com

Bhuwan
  • 16,525
  • 5
  • 34
  • 57
acemaxs
  • 19
  • 2

1 Answers1

0

Add this to the htaccess file in your document root, above any rules that may already be there:

RewriteEngine On
RewriteCond %{HTTP_HOST} old\.com$ [NC]
RewriteRule ^(.*)$ http://new.com/$1 [L,R=301]

You have to use mod_rewrite because wordpress uses it to route everything to its index.php using mod_rewrite, and mod_alias directives don't always play nicely with mod_rewrite (e.g. Redirect vs RewriteRule).

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • still now working its, only redirect example.old.com to new.com how to redirect example.old.com to example.new.com ? thanks for respon ;) – acemaxs Oct 16 '13 at 02:07
  • @acemaxs replace `old\.com` with your old hostname, and `new.com` with your new hostname. – Jon Lin Oct 16 '13 at 02:11
  • i have, it's wordpress multisite, i moved it to new domain. use that code work for subdomain.old.com to new.com but doesn't work for subdomain.old.com to subdomain.new.com – acemaxs Oct 16 '13 at 02:14
  • @acemaxs The rules have to go in the document root of `subdomain.old.com` – Jon Lin Oct 16 '13 at 02:30
  • i mean subdomain = every subdomain in wordpress multisite. the root document is same place with main domain. – acemaxs Oct 16 '13 at 02:33
  • i still can't find the solution. – acemaxs Oct 16 '13 at 06:31