Hi
I have installed a wordpress multisite.
In http://my-site.com/wp-admin/my-sites.php, the setting for the main site is http://my-site.com/subsite2
All is ok. No problem.
I copy and I paste this WP multi in an intranet. I use a search / replace script for the db.
First problem I see in the intranet: images used in the homepage are no displayed.
Images have an URL like http://my-site.com/subsite2/wp-content/uploads/site/2/foo.jpg
But I confirm that images are present on the server FTP
Second problem I see : all others URLs is not working (wp-admin doesn't work)
Have you got an idea about where is the problem ?
Francisco Javier Carazo Gil answers:
Good afternoon,
Maybe you have broken the serialized data.
Please use a good tool to avoid this problem: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
I always recommend this one.
Sébastien | French WordpressDesigner comments:
I have use this script
Sébastien | French WordpressDesigner comments:
J'ai utilisé ce script!
J'ai remplacé les occurrences avec http: // puis les occurrences sans http: //
En fait j'ai fait mon installation d'un coté sur un serveur internet, ça a marché.
De l'autre coté j'ai suivi exactement le même protocole pour installer surun intranet et j'obtiens le probleme décrit.
Sébastien | French WordpressDesigner comments:
sorry :)
I used this script!
I replaced the occurrences with http: // then the instances without http: //
In fact I made my installation of one side on an internet server, it worked.
On the other side I followed exactly the same protocol to install on an intranet and I get the problem described.
Sébastien | French WordpressDesigner comments:
I have use the interconnectit script to search and replace url (with and without http://)
I have activated the rewrite_mod in apache and tested it wit an URL on my site, it's ok, the rewrite url works.
I have delete my htacces.
I have add this lines in my wp-config.php
define('WP_HOME','http://my-site.com');
define('WP_SITEURL','http://my-site.com');
above these lines
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'my-site.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
My homepage is displayed. But all others URLs doesn't work.
Francisco Javier Carazo Gil comments:
Are you sure Apache mod_rewrite is working and activated?
Sébastien | French WordpressDesigner comments:
As I wrote : "I have activated the rewrite_mod in apache and tested it wit an URL on my site".
Now I can see all URLs but when I want to log in, my account doesn't work...
Rempty answers:
Looks like some of urls you replaced are broken
you can use plugins like
wp migrate db to do search/replace and export
https://wordpress.org/plugins/wp-migrate-db/
Don't forget to delete htaccess and flush again permalinks
Sébastien | French WordpressDesigner comments:
delete htaccess ?
But the is the code for multisite in my htacces :
[code]# BEGIN WordPress
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).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress[/code]
it's not a problem to delete this code ?
Sébastien | French WordpressDesigner comments:
I have use the interconnectit script to search and replace url (with and without http://)
I have activated the rewrite_mod in apache and tested it wit an URL on my site, it's ok, the rewrite url works.
I have delete my htacces.
I have add this lines in my wp-config.php
define('WP_HOME','http://my-site.com');
define('WP_SITEURL','http://my-site.com');
above these lines
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'my-site.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
My homepage is displayed. But all others URLs doesn't work.
Hiro Hito answers:
I think you need to set the site URL correctly in wp-config:
define('WP_HOME','http://my-site.com');
define('WP_SITEURL','http://my-site.com');
Sébastien | French WordpressDesigner comments:
Yes but This datas are yet in the db.
I will try
Sébastien | French WordpressDesigner comments:
I have use the interconnectit script to search and replace url (with and without http://)
I have activated the rewrite_mod in apache and tested it wit an URL on my site, it's ok, the rewrite url works.
I have delete my htacces.
I have add this lines in my wp-config.php
define('WP_HOME','http://my-site.com');
define('WP_SITEURL','http://my-site.com');
above these lines
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'my-site.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
My homepage is displayed. But all others URLs doesn't work.