WordPress.org

Ready to get started?Download WordPress

Forums

3.1 RC3 Multi-site (sub-folder) login redirecting to login again (12 posts)

  1. Marcel Bokhorst
    Member
    Posted 3 years ago #

    See this issue in the multisite forum for details.

  2. As I said there, dump all your cookies and cache and try again.

    Also, multiple posts makes it harder for us to help you. Let's keep it here for now, please :)

  3. Marcel Bokhorst
    Member
    Posted 3 years ago #

    I did and even used another browser.
    Sorry for the multiple threads, but at first I didn't realize it was a RC problem.
    Is there anything else I can do to help to solve this issue?

  4. Marcel Bokhorst
    Member
    Posted 3 years ago #

    Maybe of relevance is that the network site is at a sub-domain. These are the rules my hosting provider generated in the .htaccess in the top directory:

    RewriteCond %{HTTP_HOST}    ^network.bokhorst.biz$
    RewriteCond %{REQUEST_URI}  !^/network/
    RewriteRule (.*)    		/network/$1 [last]
  5. Marcel Bokhorst
    Member
    Posted 3 years ago #

    The login redirects to:

    http://sub-domain/wp-login.php?redirect_to=http%3A%2F%2Fsub-domain%2Fwp-admin%2F&reauth=1

    (sub-domain removed)

  6. Wait ... What!?

    THIS needs to go!

    RewriteCond %{HTTP_HOST}    ^network.bokhorst.biz$
    RewriteCond %{REQUEST_URI}  !^/network/
    RewriteRule (.*)    		/network/$1 [last]

    Did you set up wildcard subdomains? If so, you have NO need for that and, in fact, that's going to cause all sorts of problems, like what you're seeing.

    For WordPress to be able to parse your subdomains, you need to have them ALL aimed at your main domain. Like mine has *.ipstenu.org pointing to /public_html/ (where WP is installed), and WordPress catches ALL subdomains and handles them internally.

  7. Marcel Bokhorst
    Member
    Posted 3 years ago #

    I didn't setup wildcard domains. The network is using sub-directories.
    It was already mentioned in the other forum, but here is my .htaccess file in the /network/ folder were WordPress is installed:

    RewriteEngine On
    RewriteBase /network/
    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]
  8. You had WordPress installed as network.domain.com and you changed this by flipping the bit in wp-config.php to Subdomains being FALSE.

    Do me a huge favor. Go into your database and check the wp_blogs table. How are your sites listed?

    I'm BETTING they're still listed as subdomain.domain.com with a path of / instead of domain.com with a path of /subdomain/

  9. Marcel Bokhorst
    Member
    Posted 3 years ago #

    What I want, but maybe that is not possible, is to run the network on the sub-domain network.domain.com (the first .htaccess in the root folder should arrange this), but the sites should go into sub-directories (the config and .htaccess WordPress generated should arrange this).

    Simply said, I don't want www.domain.com to be the root, but network.domain.com and the sites should go into sub-directories (not sub-domains).

    To summarize, what I did was setup the sub-domain, then installed WordPress in this sub-domain (this worked), then I switched WordPress as per codex to a multi-site in sub-directories (I copied the generated wp-config.php config and generated .htaccess file).

    WordPress is installed in a sub-directory (/network/).

    The wp_blogs table has only one record:

    blog_id: 1
    site_id: 1
    domain: network.domain.com
    path: /network/

    I hope this clarifies things.

  10. Ugh. Okay. Wow. That did clarify, and you did this all weird and wrong. By putting in the base/path as a call to the /network/ folder, WordPress is being told your install is http://network.domain.com/network which is NOT right.

    Your .htaccess should be in the NETWORK folder, NOT ROOT.

    You cannot run WordPress out of a Subfolder and have it act as in root. Once you make SubDOMAIN, you're no longer 'in root' but your own special domain, so just ignore it.

    Can we scrap this install and start over? I swear it easier this way :)

    1) Create a physical subdomain for network.domain.com
    2) In the /network folder, install WordPress. Your .htaccess etc will all be in here, NOT one folder up. Your setup will all be referencing network.domain.com and NEVER the network folder, because you're in the subdomain :) it already knows its in /network on the backend, so you can forget it.
    3) Set WordPress up to be SubFolders
    4) Proceed as normal.

    The other way will involve a lot of jiggering, depending on how far down the rabbit hole you went.

  11. Marcel Bokhorst
    Member
    Posted 3 years ago #

    First I want to thank you for your patience and support!

    Create a physical subdomain for network.domain.com

    How do I do that? (without .htaccess in the root folder as my hosting provider generates when I create a sub-domain)

    I installed WordPress and the network now at domain.com/network (no sub-domain) and this works, but this was not what I wanted.

    Maybe it was weird and wrong, it did work with WP 3.04.
    Is it really weird to want a sub-directory install in a sub-domain?

    Nevertheless I can test my plugin now, but unfortunately I don't see it appear on the network admin site, although I use the new action 'network_admin_menu'. But this has nothing to do with this issue, of course.

  12. Is it really weird to want a sub-directory install in a sub-domain?

    Not at all :) Somehow I just couldn't grasp that's what you wanted, because what you were describing was so weird.

    Create a physical subdomain for network.domain.com

    How do I do that? (without .htaccess in the root folder as my hosting provider generates when I create a sub-domain)

    The .htaccess bit your host put in is to PREVENT people from hitting domain.com/network (it redirects them to network.domain.com and that's fine). So actually that's not it at all, my bad, I misunderstood what you meant.

    How you create a physical subdomain depends on your host. Mine has cpanel, so I go in, hit up the subdomains panel, and add in 'network'. Your host should have 'How to make a subdomain' directions.

    (A 'virtual' subdomain would be the wildcard subdomains we use to point *.domain.com to ANY subdomain - which is what we suggest you do if you want to run the subdomain install of WordPress. You want the SubFOLDER one, so you don't have to worry about that.)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags