WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sub-domain install dashboard login caught in loop (9 posts)

  1. reasie
    Member
    Posted 1 year ago #

    I'm trying to migrate our website to wordpress, and we have a number of virtual hosts. I followed the instructions for setting up multisite from the codex and I registered the primary and secondary hostnames with our DHCP master.

    I realize this is possibly the source of my problem: when I add the site, WordPress adds it at host2.mainhost.mydomain.edu, and what I have regsistered with DNS and what I need to use is host2.mydomain.edu. If I edit the domain in the 'edit site' window, it gets me to the login screen, but no farther. The login will shake and error with an incorrect password or username, but the correct password and username just refreshes the login window.

    If I don't change the defaulted domain name and change my vhost conf to match host2.mainhost.mydomain.edu - it just doesn't work. 404 not found.

    If I do change the hostname, it does load with a default look:
    http://povertycenter2.case.edu

    Here is my virtual hosts configuration:

    <VirtualHost *:80>
    ServerName mainhost.mydomain.edu
    ServerAdmin myemail@mydomain.edu
    DocumentRoot /var/www/html/
    ErrorLog logs/wp_log
    </VirtualHost>

    <VirtualHost *:80>
    ServerName host2.mydomain.edu
    ServerAdmin myemail@mydomain.edu
    DocumentRoot /var/www/html/
    ErrorLog logs/host2_log
    LogLevel debug
    </VirtualHost>

    WordPress is installed in /var/www/html/

    After trolling the forums for the past couple days, I've re-written .htaccess a dozen times to no affect, but here it is currently:

    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 ^wp-admin$ wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) wp/$1 [L]
    RewriteRule ^(.*\.php)$ wp/$1 [L]
    RewriteRule . index.php [L]

    (I've removed and re-added the "upload files" section most recently to no affect.)

    I've seen recommendations to add a domain mapping plugin, but the ones I see aren't tested in 3.5 - help?

  2. Jesús Franco
    Member
    Posted 1 year ago #

    Look at the lines in your .htaccess referred to php files, they look like causing the redirect loop, because you are redirecting every request to a php file to another file inside wp/ directory.

    If you are putting all your core php files in wp directory, probably your RewriteRule should include this previous condition:

    RewriteCond %{REQUEST_URI} !^wp/(.*)$
    RewriteRule ^(.*\.php)$ wp/$1 [L]

    Have you tried with the default .htaccess rules? Why are you redirecting to wp/ directory?

  3. reasie
    Member
    Posted 1 year ago #

    Honestly, I was copying code frantically from various posts on this forum from people who said they had similar problems. So I've removed the redirect to wp directory, since I don't HAVE a wp directory...

    This is my .htaccess now - still no change in the behavior of the site:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

  4. Jesús Franco
    Member
    Posted 1 year ago #

    These looks like the .htaccess directive for subdirectories, but you are trying to use subdomains instead. Re-visit your /wp-admin/network/setup.php and check how are you configuring your network.

    BTW, do you really need a network setup? Would be easier maybe just to maintain 2 different wordpress installations, maybe sharing one table of users.

    You could be interested in further explanation:
    http://codex.wordpress.org/Installing_Multiple_Blogs
    http://halfelf.org/2011/dont-use-wordpress-multisite/

  5. reasie
    Member
    Posted 1 year ago #

    I've been googling diligently for the .htaccess file to write for subdomains to no avail. The codex just says 'add the lines you're given' which I did do, but all this troubleshooting has resulted in multiple re-writes of the file. Is there an easy way to get the code back other than removing multisite and starting over?

    Ironically, I thought using multisite would be easier than having independent installations of wordpress to manage for each of our old vhosts.

  6. when I add the site, WordPress adds it at host2.mainhost.mydomain.edu, and what I have regsistered with DNS and what I need to use is host2.mydomain.edu.

    Where is WP installed? mainhost.mydomain.edu?

    If you want to have host2.mydomain.edu, then you actually need to install in mydomain.edu or experiment with domain mapping.

    It's possible to use the WPMU Domain Mapping plugin to map host2.mydomain.edu to host2.mainhost.mydomain.edu, but it won't work on all sites.

  7. reasie
    Member
    Posted 1 year ago #

    Our DNS system automatically collapses subdomains - our real hostname is msass.sass.case.edu, but it's reachable by msass.case.edu. The host is registered with DNS as both msass.case.edu and povertycenter.case.edu - and all the other hostnames I need. I'm sorry if that wasn't clear. The hostnames all 'work', I just can't get wordpress to let me administrate them because the dashboard won't load.

  8. Yeah, WP Multisite is not very good with that kind of setup.

    Have you considered using subfolders? Like mainhost.mydomain.edu/host2 and mapping those?

  9. reasie
    Member
    Posted 1 year ago #

    Yeah... I've finally seen the light, stopped tweaking and re-tweaking, and just set up multiple instances. Heh. Amazing how easy that was, when I thought multisite would be easier. I guess multisite just wasn't the solution for the setup I have. Thank you all for your time and patience, especially over a holiday!

Topic Closed

This topic has been closed to new replies.

About this Topic