By Luis Lopes
Good morning guys, I want to setup a wordpress multisite subdirectory hosted in DO and working with serverpilot. When I change the .htaccess and wp-config.php I can’t even login it shows a blank page, redirects from http://www.site.com/wp-admin to http://site.com and in Developer Tools appears like a error 301/302 loop. Sincerely I don’t know what is happening, ok I know it’s the first time that I setup a multisite in a VPS host, however in a shared host I can al the times setup that successfully.
So this is my .htaccess file:
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]
And my wp-config.php file
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'www.site.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
Thank you very much for your help :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
@luismiguelopes - If your site is down as a result of the .htaccess configuration, you can always backup your .htaccess (download a copy) and then delete it from your web root after commenting out the define lines in wp-config.php. Once you’ve done this, refresh the page and/or attempt to access yourdomain.ext/wp-admin and a new .htaccess should be generated for you (if not, clicking “save” on the permalinks page will regenerate it for you).
When commented out, the lines should look like:
//define( 'MULTISITE', true );
//define( 'SUBDOMAIN_INSTALL', false );
//define( 'DOMAIN_CURRENT_SITE', 'yourdomain.ext' );
//define( 'PATH_CURRENT_SITE', '/' );
//define( 'SITE_ID_CURRENT_SITE', 1 );
//define( 'BLOG_ID_CURRENT_SITE', 1 );
Once you’re ready to reattempt the installation, the following should be set in wp-config.php
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', 'yourdomain.ext' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
Ideally, yourdomain.ext should be setup without the www. attached (as shown in the example above).
For the .htaccess file, try:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# Add Trailing / 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]
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.