Sub directory installation with subdomains (6 posts)

  1. xanuex
    Posted 4 years ago #

    Hi guys,

    I've recently installed WordPress MultiSite with the sub directory setting (because this is what my provider, one.com, supports).

    Since I do want to use subdomains I did the following:
    wp-config.php [altering this line from false to true]
    define( 'SUBDOMAIN_INSTALL', true );

    .htaccess [changing it to this]

    RewriteEngine On
    #rewriting wordpress stuff to the root
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/wp-((content|admin|includes)|((cron|login)\.php))
    RewriteCond %{HTTP_HOST} ([a-zA-Z0-9-]+\.([a-z]{2,4})|co\.uk|me\.uk|org\.uk|priv\.no)$
    RewriteRule ^(.*)$ http://%1/%{REQUEST_URI} [L,QSA]
    #rewriting everying that can't be found to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    #rewriting everything else to index.php
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteCond %{REQUEST_URI} !^/wp-(content|admin|includes|login|cron)(\.php)?
    RewriteRule . index.php [L]

    It works almost flawless...
    the sites that I create end-up nicely to be reachable subdomains. The only problem which is kind of a downer is that /wp-admin isn't working so I cannot change the site and I'm stuck with the default template :)

    subdomain.domain.com/wp-admin is now redirecting towards http://www.domain.com/wp-signup.php?.., simply because the 'page' does not exist.

    My question:
    Is there a die-hard .htaccess person who can tell me how I can make sure that wordpress is redirecting this correctly too and my wp-admin is working on the subdomains as well?

    I guess if this script works it might be nice for others too :-)

    Thanks in advance,

  2. petimi
    Posted 4 years ago #

    same problem here with one.com installing multisite

    does anyone has a fixed up htaccess code?

  3. xanuex
    Posted 4 years ago #

    No worries petimi, I've written a plugin myself :)

    Will put it online asap, I'll drop the url here when ready!

  4. Wait ... are you saying you need BOTH subdomain and subfolder?

    Becuase we totally have a .htaccess already for subdomains.


  5. xanuex
    Posted 4 years ago #

    Ow sorry... I just realized I've replied a reaction on the wrong post :)

    I too am a client of one.com

    They gave me the following .htaccess to use:

    but in the end they told me that they don't support subdomain installation and for that I couldn't get the given .htaccess to work either. :)

    I've chosen for a subdir installation instead.
    What you can do is using subdomain forwards but of course this isn't the real thing ;)

    Thanks for the comment! I did try this .htaccess too but like said.. unfortunately one.com doesn't support it.

  6. Well ... Wow. That's crazy stupid of one.com and I will go hit them with a hammer now.

Topic Closed

This topic has been closed to new replies.

About this Topic