• Hello,

    I have a multisite network where the “main site” is publicly accessible (criticalpublichealth.org, in case that helps), and the subsites are only accessible to registered users. We have recently developed a problem —

    When subsite users who haven’t logged in yet go to [mainsite.org/subsite], they are redirected to a login url like [mainsite.org/subsite/login.php]. Although this redirection used to work, now users get a message saying that the redirect will never resolve. The only way to login now is through [mainsite.org/login.php].

    Unfortunately I’m not sure exactly when this problem started. I’ve tried disabling all plugins but there is no difference. Any ideas would be greatly appreciated.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    How did you set up the redirection in the first place?

    Thread Starter surrogatekey

    (@surrogatekey)

    Hm, I’m using the More Privacy Options plugin to limit subsite access, so I guess it would be that. With More Privacy Options turned off though, I still get the same message. For example, if I’m logged in to the subsite and then logout, I get the same unresolvable redirect message, and the url it’s trying to get to still starts with [mainsite.org/login.php].

    Thread Starter surrogatekey

    (@surrogatekey)

    Oops meant to say the redirect url still starts with [mainsite.org/subsite/login.php]… Hope that makes sense…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    What’s in your .htaccess?

    And do you have NOBLOGREDIRECT in your wp-config?

    Thread Starter surrogatekey

    (@surrogatekey)

    Ugh, my apologies for losing track of this for so long, and thanks for your reply.

    I don’t see NOBLOGREDIRECT in my wp-config, and here’s what’s in my .htaccess:

    #WFIPBLOCKS - Do not remove this line. Disable Web Caching in Wordfence to remove this data.
    Order Deny,Allow
    Deny from 14.97.148.249
    #Do not remove this line. Disable Web Caching in Wordfence to remove this data - WFIPBLOCKS
    #WFCACHECODE - Do not remove this line. Disable Web Caching in Wordfence to remove this data.
    <IfModule mod_deflate.c>
    	AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    	<IfModule mod_headers.c>
    		Header append Vary User-Agent env=!dont-vary
    	</IfModule>
    	<IfModule mod_mime.c>
    		AddOutputFilter DEFLATE js css htm html xml
    	</IfModule>
    </IfModule>
    <IfModule mod_mime.c>
    	AddType text/html .html_gzip
    	AddEncoding gzip .html_gzip
    	AddType text/xml .xml_gzip
    	AddEncoding gzip .xml_gzip
    </IfModule>
    <IfModule mod_setenvif.c>
    	SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip
    	SetEnvIfNoCase Request_URI \.xml_gzip$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
    	Header set Vary "Accept-Encoding, Cookie"
    </IfModule>
    <IfModule mod_rewrite.c>
    	#Prevents garbled chars in cached files if there is no default charset.
    	AddDefaultCharset utf-8
    
    	#Cache rules:
    	RewriteEngine On
    	RewriteBase /
    	RewriteCond %{HTTPS} on
    	RewriteRule .* - [E=WRDFNC_HTTPS:_https]
    	RewriteCond %{HTTP:Accept-Encoding} gzip
    	RewriteRule .* - [E=WRDFNC_ENC:_gzip]
    	RewriteCond %{REQUEST_METHOD} !=POST
    	RewriteCond %{HTTPS} off
    	RewriteCond %{QUERY_STRING} ^(?:\d+=\d+)?$
    	RewriteCond %{REQUEST_URI} (?:\/|\.html)$ [NC]
    
    	RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|wf_logout|wordpress_logged_in|wptouch_switch_toggle|wpmp_switcher) [NC]
    
    	RewriteCond %{REQUEST_URI} \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$
    	RewriteCond "%{DOCUMENT_ROOT}/wp-content/wfcache/%{HTTP_HOST}_%1/%2~%3~%4~%5~%6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" -f
    	RewriteRule \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$ "/wp-content/wfcache/%{HTTP_HOST}_$1/$2~$3~$4~$5~$6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" [L]
    </IfModule>
    #Do not remove this line. Disable Web caching in Wordfence to remove this data - WFCACHECODE
    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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You should try turning off all that caching in .htaccess

    Thread Starter surrogatekey

    (@surrogatekey)

    Thanks. So with caching disabled the problem persists, and .htaccess looks like this:

    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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It may be a miss-match of the domains. Can you check your tables to see if you have a combination of https://www.domain.com abd domain.com in your wp_sites tables?

    Thread Starter surrogatekey

    (@surrogatekey)

    Hi – I’m not sure if I’m looking at the right thing, but I have a table called “wp_site” that contains this:

    id: 1
    domain: criticalpublichealth.org
    path: /

    Thread Starter surrogatekey

    (@surrogatekey)

    Maybe this was already clear, but I wanted to add that just entering the a login url directly, for example:
    mainsite.org/subsite/wp-login.php
    produces the same “The page isn’t redirecting properly” result.

    I have no idea where this redirect comes from or what it’s supposed to do. Can anyone point me in the right direction?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Sorry, I saif the wrong table.

    wp_options.

    Look for siteURL and home.

    They shoudl BOTH be https://criticalpublichealth.org

    Thread Starter surrogatekey

    (@surrogatekey)

    Thanks. Yep, they’re both https://criticalpublichealth.org

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Okay, that’s good… but weird.

    How did you set it so subsites are only accessible to registered users?

    Thread Starter surrogatekey

    (@surrogatekey)

    Okay, that’s good… but weird.

    Story of my life ??

    I’m using the More Privacy Options plugin to limit the subsites, with Site Visibility set to “Visible only to registered users of this site.” But with all the plugins disabled, I still get a redirect error if I try to go to
    mainsite.org/subsite/wp-login.php
    (That should work, right?)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yeah, that should *head scratch*

    Have you tried on a different browser?

    I use Chrome and have this installed – https://chrome.google.com/webstore/detail/redirect-path/aomidfkchockcldhbkggjokdkkebmdll – to tell me where things are redirecting, so I can see that a site goes between www and non-www versions, for example. Maybe that can shed some insight.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Subsite login urls not working’ is closed to new replies.