WordPress.org

Forums

[resolved] 'My Sites' link not working for fresh install - 500 and 404 errors (6 posts)

  1. jasrasr
    Member
    Posted 1 year ago #

    I just installed a new installation of wordpress 3.8.1, then set it to sub directory, then enabled network. jasonlamb.me is blog address, jasonlamb.me/wp is blog location (http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory). I enabled and activated the network. Now when I click on 'My Sites' > Network Admin I get a 'page not found'. When I click on any other My Sites > Sites, Users, Themes, Plugins: I get a error 500 Internal Server Error page. I can't even create a new network site because it tries to load the http://jasonlamb.me/wp-admin/network/site-new.php?action=add-site and if I manually type in wp/ after .me (http://jasonlamb.me/WP/wp-admin/network/site-new.php?action=add-site) for the URL it brings up a page that says nothing but "Are you sure you want to do this?" and no button to say, YES!

    Once I click on any of the My Sites > Dashboard, Sites, Users, Themes, Plugins; I have to change the URL to add 'wp/' after 'jasonlamb.me' for it to load the page properly. Below is my htaccess:

    RewriteEngine On
    RewriteBase /
    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).*) jasonlamb_me/wp/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ jasonlamb_me/wp/$2 [L]
    RewriteRule . index.php [L]

    And I added this as directed by wordpress setup:

    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'jasonlamb.me');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    So my main question is how do I change the URL or file path so when it goes to anything for the network it will pick up the wp/ after .me so it will load the right page instead of unknown 404? My work around right now that works for most pages except those with form submissions is to manually add the wp/ between jasonlamb.me/ & wp-admin/network

    One more thing to note, I do have screenshots if you would like to see exactly what I am talking about. Also I have setup many wordpress networks/multisites, but never have I tried like where the blog url and location are different. jasonlamb.me is the URL for the blog I am attempting to change. If you go to the main page you will see the login link points to jasonlamb.me/wp/login.php

  2. Going to http://jasonlamb.me/wp-admin properly redirects me to http://jasonlamb.me/wp/wp-login.php

    But WP Multisite actually doesn't care about the WP thing. I mean, it's capable of using it or not.

    I do wonder why you have jasonlamb_me/wp/ in the .htaccess though, that seems very odd. This would be a more standard .htaccess:

    RewriteEngine On
    RewriteBase /wp/
    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]
  3. jasrasr
    Member
    Posted 1 year ago #

    I apologize, I must have copied a version of the .htacces when I was testing a few things. I just looked at it again and it is set the way you posted. But no, either way didnt't fix anything. Any other ideas? Good eye though.

  4. Try changing define('PATH_CURRENT_SITE', '/'); to be define('PATH_CURRENT_SITE', '/wp/');

  5. jasrasr
    Member
    Posted 1 year ago #

    After changing that I get a lovely page that says, "Error establishing a database connection."

    It did have me change the jasonlamb.me/index.php to:

    require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

    The jasonlamb.me/wp/index.php has

    require( dirname( __FILE__ ) . '/wp-blog-header.php' );

    I guess because it is in the local directory as needed.

  6. jasrasr
    Member
    Posted 1 year ago #

    SOLVED!

    The code that the wordpress setup gave me for the network setup for the htaccess file was wrong.

    The code it had me copy to htaccess file was:

    RewriteEngine On
    RewriteBase /
    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).*) jasonlamb_me/wp/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ jasonlamb_me/wp/$2 [L]
    RewriteRule . index.php [L]

    And notice the jasonlamb_me folder before wp/. That make sense if you look at the fact that the file is located one directory above the wp/ directory. But since the root files are located in the wp/ folder it was referencing a folder stucture of jasonlamb_me[ACTAUL LOCATION]/jasonlamb_me/wp/[BLAH].

    The correct htacess file should be...and yes it does work just fine and dandy with no conflicts I have found so far.

    RewriteEngine On
    RewriteBase /
    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).*) wp/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
    RewriteRule . index.php [L]

    The only two lines that were changed were:`
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) jasonlamb_me/wp/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ jasonlamb_me/wp/$2 [L]

    The only omission was the:

    jasonlamb_me/
    `

    This was setup as a fresh install, then moving the actual files to their own directory (one level down) [see link in original post for information], the setup as network (multisite). The problem occured when the network setup gives you the htaccess code for the update network status.

    I hope this helps someone down the road. It was very frustrating for me.

Topic Closed

This topic has been closed to new replies.

About this Topic