I have a wordpress multisite installation which would like to move from the productive domain to my localhost, so the the installation should be altered in a way that somedomain.com
becomes localhost/dirname
.
Right now I have these settings in wp-config.php
:
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', 'localhost' );
define( 'PATH_CURRENT_SITE', '/dirname/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
define( 'SUNRISE', 'on' );
and the .htaccess
looks like:
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*.php)$ $1 [L]
RewriteRule . index.php [L]
Right now an infinite redirect loop starts to: http://localhost/dirname/wp-signup.php?new=localhost
Which settings do I have to make?
Greetings,
philipp
EDIT
If WP_ALLOW_MULTISITE
and MULTISITE
is set to false
this problem does not occur, but since I need to access the page as multisite this is no option.
If you’re moving a wordpress installation, after importing the database into your local mysql server. Edit your wp-config.php file, changing the ‘DB_NAME’ ‘DB_USER’ ‘DB_PASSWORD’ ‘DB_HOST’ to reflect the settings for your local database. Then use this script http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ to search for your domain name and replace it with localhost/dirname. After that you login and save your permalinks.
Hope it helps.
JUst checked, to install WordPress MU in localhost on subdomain/subdirectory, you need to set up virtual hosting in Windows system.
Go to C:WINDOWSsystem32driversetc and open the file âhostsâ with notepad (you need to have administrator privilege to edit the file. Right click the Notepad application in the Start menu and select Run As Administrator).
Insert in the line
127.0.0.1 localhost.localdomain
to the end of the file. Save and close the file.
If you are using mac os, you can follow this http://wpdreamer.com/2013/08/how-to-setup-a-localhost-wordpress-sub-domain-multisite-environment/
You could change it to localhost.com, then edit your wp-config file to reflect that, also change the values in the database using http://interconnectit.com/products/search-and-replace-for-wordpress-databases/