WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Please help me set up a network, redirect problems (7 posts)

  1. Sho-Down
    Member
    Posted 6 months ago #

    The only reason I'm doing a network is because I want to share WordPress users and plugin data with a mobile version of my site. So if a user signs up on my mysite.com, they are also a member of mobile.mysite.com (and vice versa). And if they rate something on the .com, the rating will also be on the mobile site (using a rating plugin). Is a network the only way to achieve this? I've been pulling my hair out for 4 hours and I can't get the multisite set up.

    WordPress 3.5.1
    Plesk 10.4.4
    riptest.info (this is my test domain I'm testing this on)

    Here are my steps:
    1. Deleted all plugins
    2. Changed to default Twenty Twelve theme
    3. Changed the siteurl and home url in database to no "www"
    4. Created a vhost.conf file in riptest.info/conf/ with this in it

    ServerAlias "*.riptest.info"
    <Directory /var/www/vhosts/riptest.info/>
    AllowOverride FileInfo Options
    php_admin_flag safe_mode off
    </Directory>

    5. Added *.riptest.info. CNAME riptest.info. to the DNS of riptest.info domain
    6. Added define( 'WP_ALLOW_MULTISITE', true ); to wp-config

    Then I click "Install", it does it's thing for 15 seconds and the following page (network.php) is blank, when I view source I can see there is content but the area is white. So I click Tools>Network Setup again and it takes me to the page to copy/paste the stuff to wp-config and htaccess.

    I copy and paste what it tells me to into wp-config and htaccess except I change define('SUBDOMAIN_INSTALL', false); to TRUE. I upload the two files, click the log in button on WordPress and it takes me to "http://www.riptest.info/wp-signup.php?new=www.riptest.info" and I get a redirect loop.

    I'm wondering if this is a problem with my httpd.conf file in my etc/httpd/conf/ folder, I open httpd.conf and the virtualhost is green (commented out). Could this be the problem?

    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for requests without a known
    # server name.
    #
    #<VirtualHost *:80>
    #    ServerAdmin webmaster@dummy-host.example.com
    #    DocumentRoot /www/docs/dummy-host.example.com
    #    ServerName dummy-host.example.com
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    #</VirtualHost>
  2. Sho-Down
    Member
    Posted 6 months ago #

    Well I got rid of the white blank page after clicking "Install", it took 45 seconds and then finally showed the page with the stuff to add to wp-config and htaccess. Still redirects to http://riptest.info/wp-signup.php?new=riptest.info though.

    WP-CONFIG

    /* Multisite */
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'riptest.info');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    /* That's all, stop editing! Happy blogging. */

    This in .htaccess

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [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).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    If I change define('SUBDOMAIN_INSTALL', true); to false then I get Error establishing a database connection. Does anyone have a CLUE what the problem is? This is ridiculous.

  3. Is a network the only way to achieve this?

    No, it's not the only way. Lots of plugins do this for basic cases like WPtouch , WordPress Mobile Pack or WP Mobile Edition, etc.

    I'm not entirely sure but I think it would be more efficient to write some code to detect visitor type and select theme, rather than using a network. I think the logic would be something like this...never done this before.

    function filter_switchTheme($theme)
           {
           $mobile = mobile_device_detect();
           if ($mobile==true)
                  {
                  $theme = 'name_of_mobile_theme';
                  }
           return $theme;
           }

    See: http://detectmobilebrowsers.mobi/. Not something that gets talked about a lot in this forum :)

    But even if you do that, can't you just make the theme responsive so it looks nice on mobile devices?

  4. Sho-Down
    Member
    Posted 6 months ago #

    I've definitely researched those but this isn't a basic case. The mobile theme I purchased has it's own WordPress admin settings, so a simple detect plugin+switch theme wouldn't work because it wouldn't activate the theme with my custom menu, settings, etc. The mobile theme I bought specifically states that it has to be on it's own copy of WordPress.

    I was going to create a network so I could tie in my user database and plugins so it's more seamless...but holy cowwww what a headache it's been so far lol.

    I'm thinking it has something to do with the httpd.conf file having the virtual hosts section commented out, something in there needs to be changed and that's what I'm currently Googl'ing.

  5. Sho-Down
    Member
    Posted 6 months ago #

    So I dropped (deleted) the entire database, deleted all WordPress folders and files, uploaded/installed clean WordPress 3.5.2 and ran the Network install and it WORKED.

    So does that mean there's some weird stuff going on in my database from a plugin that was causing the redirect?

  6. That would be the implication, ytes.

  7. Sho-Down
    Member
    Posted 6 months ago #

    I don't understand why multisite still wouldn't install correctly when the plugins are disabled. I noticed when I installed a network on a fresh WordPress, it creates wp_2 entries in the database (or something like that). Trying again on my already set up WordPress site with plugins disabled, I do not get those entries. So it's like the install isn't finishing, maybe that's why I sometimes get the blank page on network.php

    define('SUBDOMAIN_INSTALL', false); = error establishing connection
    define('SUBDOMAIN_INSTALL', true); = redirect loop

    Any idea which plugin could be causing the issue? Here are the ones I have installed:

    All In One SEO Pack
    Contact Form 7
    Contact Form 7 Leads Tracking
    Google XML Sitemaps
    My favorite posts
    Really Simple CAPTCHA
    Register Plus Redux
    Relevanssi
    Simple:Press
    Wordpress Thread Comment
    WP-PostRatings
    Yet Another Related Posts Plugin

Reply

You must log in to post.

About this Topic