I have to move a WordPress multisite from one server to another. I duplicated all my files and the db and now I would like to test it by browsing a few of the installed blogs. Unfortunately I can't access them because the URL rewrite rules in my .htaccess redirect me to the root URL.

For example, say the hostname of the WP multisite is example.com and one of the install blog's URL is example.com/installedblog/. On the new server, I haven't set up my DNS, yet and I can only access my site using the IP address and username, like this: This URL works, but if try or, I get redirected to the Apache 404 page.

My .htaccess is the default one for Wordpress MU, which works on the server with DNS set up:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

I've also tried changing RewriteBase to /~username/ and it didn't work, either.

I'm thinking the problem is that the Site URL of I my WordPress is example.com/, not, so if I want to test it on the new server I would have to change it to and than back to example.com, which is an unnecessary hassle.

Since I can't delete my post, please close it, because I seem to have answered my own question.


Don't change the .htaccess, just change your wp-config.php with your new DNS (name or IP address).

Try to modify these variables:

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', '' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
  • Thanks for your help. I can now access WP on my new server without being redirected to the old domain. Doing so, I realized that I was actually being redirected to 127.0.01/wp-admin and shown the Apache 404 page (and not being redirected to However, I definitely say Apache's rewrite module installed and active in WHM... Can you think of another reason why I might be being server the 404 error document? – bogdanvursu Jan 7 '12 at 8:31
  • try to change this variable: define( 'PATH_CURRENT_SITE', '/' ); in define( 'PATH_CURRENT_SITE', '/~username/' ); In any case, the you can solve all redirect problem with the config file :) – Giuseppe Morelli Jan 11 '12 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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