• I’m setting up WP Multisite to manage a conference site. The conference organizer has 2 conferences a year and wants to create separate sites for each conference.

    Previously I just used separate WP sites, but it seems like it might be better to use WP multisite for this situation.

    However, I can’t figure out how to redirect the root to one of the subdirectories. Here’s more detail.

    There are lots of other subsites:

    acmeconference.com/hawaii-2013
    acmeconference.com/portland-2013
    acmeconference.com/hawaii-2012
    acmeconference.com/portland-2012

    and so on….

    I want to make it so that any user who goes to acmeconference.com gets redirected to the closest upcoming conference. IN this case, to acmeconference.com/portland-2014. But I still want to manage all of these subsites from acmeconference.com/wp-admin. I just don’t want acmeconference.com to be its own site that users first land on before drilling into a subdirectory.

    Previously, without multisite, I simply had this in my .htaccess file:

    RewriteEngin eOn
    RewriteCond %{HTTP_HOST} ^(www.)?acmeconference.com$
    RewriteRule ^(/)?$ 2013 [L]

    Users who landed on acmeconference.com would be redirected to acmeconference.com/2013.

    After installing WP Multisite, my .htaccess file has 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]

    I tried adding the old .htaccess redirect code into the new .htaccess file, but it doesn’t do anything. Can you help me add the right redirect rule so that users going to acmeconference.com get redirected to /2014, but admin users going to acmeconference.com/wp-admin do not get redirected?

    Thanks,

    Tom

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to redirect root to subdirectory with multisite’ is closed to new replies.