• Resolved reasie

    (@reasie)


    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:
    https://povertycenter2.case.edu

    Here is my virtual hosts configuration:

    <VirtualHost *:80>
    ServerName mainhost.mydomain.edu
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/
    ErrorLog logs/wp_log
    </VirtualHost>

    <VirtualHost *:80>
    ServerName host2.mydomain.edu
    ServerAdmin [email protected]
    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 ?les
    RewriteRule ^([_0-9a-zA-Z-]+/)??les/(.+) wp-includes/ms-?les.php??le=$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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • 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?

    Thread Starter reasie

    (@reasie)

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

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

    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:
    https://codex.www.ads-software.com/Installing_Multiple_Blogs
    https://halfelf.org/2011/dont-use-wordpress-multisite/

    Thread Starter reasie

    (@reasie)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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.

    Thread Starter reasie

    (@reasie)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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?

    Thread Starter reasie

    (@reasie)

    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!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Sub-domain install dashboard login caught in loop’ is closed to new replies.