• I have a problem with links to different servers in WordPress Multisite

    When setting in wp_config file is like so:
    define(‘PATH_CURRENT_SITE’, ‘/wordpress/’);

    Links to network admin (https://localhost/wordpress/wp-admin) and main site (localhost/wordpress) work but other sites fail, for example localhost/wordpress/anothersite

    If I add an xtra forward slash in wp_config.php to:

    define(‘PATH_CURRENT_SITE’, ‘//wordpress/’);

    Only the link to network admin fails but all site url work.

    I believe there is a problem with the web.config file but do not know how to configure it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @wolfberryz Hello, I have setup multisite network in my local system and checked this issue. I have done below changes in wp-config.php and .htaccess files.

    Network configuration rules for .htaccess :

    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /wp_multisite/
    RewriteRule ^index\.php$ - [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]

    Network configuration rules for wp-config.php :

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    define( 'DOMAIN_CURRENT_SITE', 'localhost' );
    define( 'PATH_CURRENT_SITE', '/wp_multisite/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    In example main site (localhost/wp_multisite) and other site (localhost/wp_multisite/anothersite/). Also, update permalink once. My multisite network working properly with all sites url. do you have done those changes ? if not then please try it.

    • This reply was modified 1 year, 4 months ago by Vishwa.

    It seems like you’re encountering issues with links to different servers in your WordPress Multisite setup. The problem might be related to the configuration in the wp_config.php file and potentially the web.config file. Here’s a suggestion:

    In your wp_config.php file, use the following configuration:

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'localhost');
    define('PATH_CURRENT_SITE', '/wordpress/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Make sure your web.config file is configured to handle WordPress Multisite. You can use the following as a starting point:

    <configuration> <system.webServer> <rewrite> <rules> <rule name="WordPress" patternSyntax="Wildcard"> <match url="*" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> </system.webServer> </configuration>

    Make sure to replace ‘localhost’ with your actual domain if you’re not working locally.

    This configuration should help resolve the issue with links to different sites in your WordPress Multisite setup. If the problem persists, you may want to check your server logs for any specific error messages that could provide more insights into the issue. For more info you can contact us @ Top Care ER

    • This reply was modified 10 months, 3 weeks ago by humajackson.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress multisite urls fails, WordPress seem to redirect incorrectly’ is closed to new replies.