• Resolved creativepublishing

    (@creativepublishing)


    Hello!

    I just installed a fresh install of WordPress and activated the network/multisite feature.

    I had no problem editing the .htaccess and wp-config.php file as I am reasonably competent in programming. The only deviation from the Network tutorial was that WordPress changed one htaccess rule, adding in my servers path.

    Creation of the first sub-blog went fine, but when trying to access the admin panel for the new blog I go into an infinite redirect loop. The blog itself loads fine, although with no formatting, I assume because I haven’t enabled any themes.

    The url is https://www.hostingserversdedicated.com/test/

    Any help would be greatly appreciated.

Viewing 15 replies - 31 through 45 (of 56 total)
  • Thread Starter creativepublishing

    (@creativepublishing)

    If you are certain you tried the boilerplate code from the beginning of the post EXACTLY as it was listed, then I’m afraid I don’t know what to offer as guidance. I see two differences between the boilerplate and what you currently have:

    1. At the very bottom you have a couple lines that are designed to redirect the www to the non-www. That is not in the boilerplate.

    RewriteCond %{HTTP_HOST} ^aaa\-my\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.aaa\-my\.com$
    RewriteRule ^/?$ "http\:\/\/aaa\.my" [R=301,L]

    2. You also have some variable references on these lines:

    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]

    Whereas the boilerplate has:

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]

    I would try these:
    1. This is just the same boilerplate as above – please try this one more time for me, exactly as this with no additions or deletions.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded ?les
    RewriteRule ^([_0-9a-zA-Z-]+/)??les/(.+) wp-includes/ms-?les.php??le=$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]

    2. This is without the www/non-www code:

    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]

    3. This one is the boilerplate minus the variable change.

    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]
    RewriteCond %{HTTP_HOST} ^aaa\-my\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.aaa\-my\.com$
    RewriteRule ^/?$ "http\:\/\/aaa\.my" [R=301,L]

    I should note that I don’t like the look of the www/non-www redirect, something deson’t look right to me about it. You should goto stackoverflow.com and search for “htaccess www to non-www redirect” there are a wealth of posts on this issue and make sure it is done correctly. Also, in the direction when installing the multi-site, there is a usggestion to take care of that feature in the options BEFORE installing the multisite code. Just something I noticed.

    Additional questions:
    Is your wordpress install at root? or in a sub-folder? i.e. aaa.com/wordpress/ ?

    The problems your describing are exactly the problems I described, so it should be a similar issue. Is this a fresh install, where you can start from scratch? or an existing blog?

    many thanks creativepublishing
    i change in .htaccess file and everything is working fine

    ??

    mankam23

    (@mankam23)

    tried everything that’s been said here but still doesn’t work for me, 3 days on it . I think I’ll just give up and create a secont wp account for my other blog. I’ve had enough really (lol). I’m using the last version of wp , it’s driving me nuts. Would have been best to have all blogs on the same acc but too much headache. looooolll fed up, thanks everyone

    ChaosByDesign

    (@chaosbydesign)

    Wow, with all of this chaos surrounding the multisite you’d think the WP gurus would have stepped in by now and said something.

    Here’s my deal – fresh 3.5.1 install, GoDaddy hosting (apache on windows os). I try to add a new site using subdomains. If I’m in the Network Admin dashboard > Sites I can see the new site I just added, HOWEVER it doesn’t appear in the My Sites in the top bar, and all I get is a 404 when I try to go to the dashboard. I’ve tried everything in here with the .htaccess and still no success.

    Since I can’t seem to find any information on this ANYWHERE, when you add a new subfoldered site, is wordpress supposed to copy anything into that new folder? Or is the folder even supposed to exist at all?

    Thread Starter creativepublishing

    (@creativepublishing)

    No, the folder does NOT exist. If the folder exists, if will give you a 404 and not work. The htaccess file checks if the folder or file its looking for exists. Only if it DOESNT exist, does it redirect to the proper file. Subdomain installs also use a different set of htaccess rules I believe so none of these in this thread should work.

    ChaosByDesign

    (@chaosbydesign)

    Ok so I removed the subfolder, went back and set my .htaccess to match what WP has in the codex for 3.5+ multisite subfolder configs, and I’m still getting 404s when I try to hit the new site. Only difference is now I’m seeing the site in My Sites.

    ChaosByDesign

    (@chaosbydesign)

    I’m moving my issue to a new thread since it might not get noticed in the back of this one, also, since the set up is a bit different.

    Thread Starter creativepublishing

    (@creativepublishing)

    Have to use the boilerplate for subdomain install if thats what your using. Subfolder wont work.

    fitbotics

    (@fitbotics)

    Does anybody have a solution for IIS installation where we use web.config file?
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name=”WordPress Rule 1″ stopProcessing=”true”>
    <match url=”^index\.php$” ignoreCase=”false” />
    <action type=”None” />
    </rule>
    <rule name=”WordPress Rule 2″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?wp-admin$” ignoreCase=”false” />
    <action type=”Redirect” url=”{R:1}wp-admin/” redirectType=”Permanent” />
    </rule>
    <rule name=”WordPress Rule 3″ stopProcessing=”true”>
    <match url=”^” ignoreCase=”false” />
    <conditions logicalGrouping=”MatchAny”>
    <add input=”{REQUEST_FILENAME}” matchType=”IsFile” ignoreCase=”false” />
    <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” ignoreCase=”false” />
    </conditions>
    <action type=”None” />
    </rule>
    <rule name=”WordPress Rule 4″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)” ignoreCase=”false” />
    <action type=”Rewrite” url=”{R:1}” />
    </rule>
    <rule name=”WordPress Rule 5″ stopProcessing=”true”>
    <match url=”^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$” ignoreCase=”false” />
    <action type=”Rewrite” url=”{R:2}” />
    </rule>
    <rule name=”WordPress Rule 6″ stopProcessing=”true”>
    <match url=”.” ignoreCase=”false” />
    <action type=”Rewrite” url=”index.php” />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    fitbotics

    (@fitbotics)

    This works in IIS7
    https://pastebin.com/47KRW1RU

    I am having the same issue with WordPress multi site.

    I have done a fresh install.
    – Unzip
    – Setup WP just with db and admin user
    – Enable multi site
    – Go to the network tab enable subdirectory multi site
    – Copy the code into the config and .htaccess
    – Create a sub site
    – Click to login to the subsite, I get a redirect loop.

    I have deleted and re-done the install 3 times, with the same error.
    I have tested all the config options throughout the pages of threads on this site all with the same issue.

    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'wp.example.com.au');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    It seems to be redirecting in code as I can remove the htaccess and I get the same redirect error.
    I have also tried enabling debugging. There are no errors in the log.

    I have tried clearing the browser and 3 different computers.

    Any ideas?

    Thread Starter creativepublishing

    (@creativepublishing)

    Redirecting in code?

    Hrmmmphff!

    Must be a header() location call. I haven’t dug through the code for WordPress much as I was just fiddling with it when I started this thread.

    I am very surprised that it redirects without the .htaccess file. Where is it redirecting to? Get a plugin for your browser and check out the headers of the server response. Something like Live Headers.

    That might help you debug the issue. Otherwise I have no idea without some more info ??

    It spews out about 10 of these then stops.

    [16:53:43.263] GET https://wp.example.com.au/site1/wp-admin/ [HTTP/1.1 302 Found 190ms]

    Request URL: https://wp.example.com.au/site1/wp-admin/
    Request Method: GET
    Status Code:
        HTTP/1.1 302 Found
        Request Headers
        16:53:43.000
    User-Agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0Host:wp.example.com.auConnection:keep-aliveAccept-Language:en-US,en;q=0.5Accept-Encoding:gzip, deflateAccept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    
    Response Headers
    Δ190ms
    X-Pingback:https://wp.example.com.au/site1/xmlrpc.phpVary:Accept-EncodingServer:ApachePragma:no-cacheLocation:https://wp.example.com.au/site1/wp-admin/Keep-Alive:timeout=15, max=84Expires:Wed, 11 Jan 1984 05:00:00 GMTDate:Wed, 20 Feb 2013 06:23:48 GMTContent-Type:text/html; charset=UTF-8Content-Length:20Content-Encoding:gzipConnection:Keep-AliveCache-Control:no-cache, must-revalidate, max-age=0

    I found where the redirect is happening.

    In wp-includes/canonical.php:525

    if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $admins ) ) {
    wp_redirect( admin_url() );
    exit;
    }

    This is the point at which it keeps looping back to the admin page.

    If I comment out this line it no longer loops, but it loads a wordpress “Page Not Found” page. This is coming from the sub site.
    It should be loading the admin system.

    var_dump of $_SERVER[‘REQUEST_URI’] – string(16) “/site1/wp-admin/”

    Also if I go to

    https://wp.example.com.au/site1/wp-admin/post-new.php

    It loads the “Page Not Found” page again. Even with the redirect line uncommented. It seems to only get into the redirect loop when its just https://wp.example.com.au/site1/wp-admin/

    Edit: I am running WP 3.5.1

    Fixed. The .htaccess was not running so it seems that it does some internal redirect.

    I found there was a “AllowOverride None” in the vhost config. Once I changed it to “AllowOverride All”, it allowed the .htaccess to run, which has then fixed the redirect loop.

Viewing 15 replies - 31 through 45 (of 56 total)
  • The topic ‘Fresh Install, subfolder multisite, infinite redirect loop sub-blog login’ is closed to new replies.