WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Links from main site to multisite sub-directories returning 301 errors ; (3 posts)

  1. sokratesagogo
    Member
    Posted 2 years ago #

    I have a few sub-directory multisites going and haven't come across this one before:

    A testing sub-directory multisite is behaving a little strangely.

    Problem: creating links on the main site to a sub-directory site - either in a menu or in the content - load very slowly.

    Using a browser developer console, and browsing such a link in the main site to the child site "Prof-smith" I see the following:

    1) Path: prof-smith, Method: GET, Status: 301, Initiator: Other, Time: 3s
    ..followed by ....
    2) Path: /prof-smith/ Method: GET, Status: 200, Initiator: http://www.etc , Time: 1s
    and the page loads normally

    I have tried disabling all plugins, and switching the theme on the main site to 2011 with no luck :(

    The htaccess file:

    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]

    Re - saving the permalink structure didn't seem to help either

    *update* If I create the link with a trailing slash - and use a fully qualified address then the page loads normally.
    What am I doing wrong?!

  2. Nothing, really, it's just that the RIGHT way to map is the full http://domain.com/site/foo/ - It'll be processed faster because it has to go through fewer loops in your .htaccess and index.php to spit out the right page.

  3. sokratesagogo
    Member
    Posted 2 years ago #

    Thanks Ipstenu :)

Topic Closed

This topic has been closed to new replies.

About this Topic