WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Wrong network admin URL (23 posts)

  1. sccr410
    Member
    Posted 3 years ago #

    When trying to go to the Network Admin using the link in the upper right of the admin, the URL is wrong. The link it gives me is:

    http://nottsforestsoccer.comwp-admin/network/

    Should be:

    http://nottsforestsoccer.com/wp-admin/network/

    I can manually add in the missing /, but nothing in the network admin works because it posts new data to the wrong URL - that I can't manually change.

    My config is

    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'nottsforestsoccer.com' );
    define( 'PATH_CURRENT_SITE', '' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Not sure if there is a setting off or what.

  2. What's yoru .htaccess look like?

  3. sccr410
    Member
    Posted 3 years ago #

    .htaccess wouldn't have anything to do with it because it doesn't get redirected to the wrong URL, it embeds the wrong URL as the link. This means there is an issue with some config option somewhere.

  4. If all your OTHER internal links work (that is the other /wp-admin/ ones for plugins, posts etc), and you've done the 'disable all plugins' dance, I still wanna see your .htaccess.

    Cause yeah, however unlikely, it remains a possibility :) And it hurts nothing to share.

  5. This means there is an issue with some config option somewhere.

    Which woudl be in your htaccess....

  6. sccr410
    Member
    Posted 3 years ago #

    .htaccess as requested...

    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]
    AddHandler php5-script .php
  7. Try this one (very small change to two lines):

    Also it's better to put AddHandler lines above your rules.

    AddHandler php5-script .php
    
    # 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
  8. sccr410
    Member
    Posted 3 years ago #

    Didn't help anything...

  9. When you go to http://nottsforestsoccer.com/wp-admin/ does it force that last / in there?

  10. sccr410
    Member
    Posted 3 years ago #

    Yes, it redirects me to the URL with the trailing slash.

    This has nothing to do with .htaccess... there is nothing wrong with any redirects. It has to do with the embedded URLs in the admin area. There are no configuration options in the .htaccess file - all that does is handle redirects. Again, nothing is redirecting incorrectly - the admin is simply giving me the wrong URL in the anchor tag.

    I just want to make sure that is the problem here and people aren't confused.

    When I click on the Network Admin URL, it is trying to link me to http://nottsforestsoccer.comwp-admin/network/ which is missing the slash after the .com. It is not redirecting me to this URL, that is the embedded URL.

  11. sccr410 - Please try and be calm. If we had a quick answer, you know we'd give it. We don't, so we're trying to be logical and reason out what your setup is, and why it's behaving badly.

    One of the MANY things the .htaccess does is this:

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    AND since the network URL is pulled in from network_admin_url() which just so happens to be a RELATIVE path, grown off of the string for the Admin url link.

    So yours is missing, and we're trying to sort out exactly WHERE it's being eaten. Since we are not logged into YOUR site, we have to ask you some weird questions to sort that out.

    Can you put echo get_admin_url(); somewhere on the FRONT end of your site and tell us what the URL is? Also check echo network_admin_url();

    If BOTH of those are fine, you may have a plugin conflict (so turn off ALL plugins, including everything in mu-plugins).

  12. It is not redirecting me to this URL, that is the embedded URL.

    and this is pulled from blog options and also run thru your rewrite rules (for the blog address) So yes, htaccess.

  13. sccr410
    Member
    Posted 3 years ago #

  14. Right then. We'll have to go for the old standards.

    1) Change your theme to Twenty-Ten (your functions.php may be overriding things)
    2) Turn off ALL plugins, including everything in mu-plugins

  15. Go check your network settings too. Make sure they are correct (yes, in the admin area).

    Neither Ipstenu & I can reproduce this.

  16. sccr410
    Member
    Posted 3 years ago #

    Nope, no go. Still get all the wrong URLs with all plugins disabled and Twenty Ten as the theme.

  17. sccr410
    Member
    Posted 3 years ago #

    What should the path setting be for the default blog that lives on the root of the domain? Right now I have it set to NULL. If I change it to "/" then everything breaks (says it cannot connect to the database).

  18. Where?

    In the database for wp_site mine is /, ditto wp_blogs...

  19. sccr410
    Member
    Posted 3 years ago #

    In wp_site it is "/" and in wp_blogs it is NULL.

    When I change them both to "/", the site breaks and I get the "Error establishing database connection"

    When I change them both to NULL, the site works but the issue still remains.

  20. sccr410
    Member
    Posted 3 years ago #

    In wp_options, changing home and siteurl to include the trailing slash also did nothing

  21. EricSchulze
    Member
    Posted 3 years ago #

    Had the same problem ... just fixed it by adding a trailing slash in the wp-config file to:

    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'xxxxx.com' );
    define( 'PATH_CURRENT_SITE', '/' );

    Hope that fix works for you.

  22. sccr410
    Member
    Posted 3 years ago #

    Adding:

    define( 'PATH_CURRENT_SITE', '/' );

    Causes "Error establishing database connection"

  23. maste
    Member
    Posted 2 years ago #

    Hello, I have the same problem with the missing / in the network admin url, and adding "/" to :
    define( 'PATH_CURRENT_SITE', '' );
    causes the error "Error establishing database connection"

    Did you solve your problem ?
    thank you for your help
    -m

Topic Closed

This topic has been closed to new replies.

About this Topic