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: 127.0.0.1/~username/. This URL works, but if try 127.0.0.1/~username/installedblog/ or 127.0.0.1/~username/wp-admin, 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 127.0.0.1/~username/, so if I want to test it on the new server I would have to change it to 127.0.0.1/~username/ 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.