• I successfully set up the network (multisite) feature of WP3 using subdomains. The example given in the docs and the dashboard show:

    site1.example.com
    site2.example.com
    site3.example.com

    However, I my situation I always end up with this:

    example.com
    site2.example.com
    site3.example.com

    I finally accepted that ONE of the sites has to be sans-subdomain and created an extra one to deal with it.

    example.com
    site1.example.com
    site2.example.com
    site3.example.com

    But now I want any visits to example.com to redirect to site1.example.com. I’m questioning if I even did this right. Any input from others who have done this would be helpful.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yeah, it really should be

    example.com
    site2.example.com
    site3.example.com

    That’s correct.

    Make a static front page on example.com and have the php file redirect, or use .htaccess to do it.

    Thread Starter instanttim

    (@instanttim)

    Normally I do use php redirects but I can’t replace the index.php as it would break wordpress so I don’t see how I could make it redirect that way. I figured I could add a rule to .htaccess but i’m not skilled at rewrite rules.

    Not to mention, it seems messy to have an actual blog in existence and taking up space in my UI that is not ever used. It seems prone to mistake, i’m sure i’ll accidentally post to it one day.

    Why does the documentation never even mention this? Seems like kind of a big miscommunication. You can’t make several parallel or “equal” sites. I of course am okay with having a “default” but this is more like a “main” or “primary” site with sub-sites.

    Thread Starter instanttim

    (@instanttim)

    For others who might read this thread, I muddled through and updated my .htaccess to do the redirect. I still don’t like that there’s this extra unused blog in the system, but I guess I’ll deal.

    Here’s the mod_rewrite code:

    RewriteCond %{http_host} ^(www\.)?example\.com$ [NC]
    RewriteRule ^(/?)$ https://site1.example.com/ [R=301,NC,L]

    This has the effect of redirecting any URL with or without a single slash but if there’s any URI (path) at all it leaves it alone.

    https://example.com
    https://example.com/
    https://www.example.com
    https://www.example.com/

    all redirect to: https://site1.example.com/

    https://example.com/path/to/something
    https://www.example.com/path/to/something

    will remain untouched.

    Normally I do use php redirects but I can’t replace the index.php as it would break wordpress so I don’t see how I could make it redirect that way.

    you can do this in the index.php that is in the THEME that is activated on the main site. ?? Not the WP index.php.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Default site of subdomain network’ is closed to new replies.