Create New Subdomains when new account/site is created

Ok, I'm looking for a bit of help...

I've installed wordpress muli-user along with the multi-domain, and domain mapping plugin.

- I've added a *.gpcsite.com subdomain to my c-panel.
- My domain is registered through go-daddy.
- I went to the MU dashboard > settings > network settings > registration and checked "Logged in users may register new sites."

Still when I register hvac.gpcsite.com I have no actual subdomain and I get an error from my cpanel (pictured in attachments).

Also, if I register a subdomain within my cpanel like I've done with test.gpcsite.com, I get an "Index of /" page (pictured in attachments).

I'd like to set the new page/account setup so that a network admin can create a site from within wordpress mu and have it just work without any complicated cpanel/database/subdomain work.

Is this possible? Please advise me on what I should be doing differently.

David R.

  • Michael Bissett

    Hey @David, Michael here! :slight_smile:

    Since you mentioned GoDaddy here, I'd like to ask, does your hosting package support wildcard subdomains? They mention that the "Web Hosting" package they have doesn't support wildcard subdomains over here:

    https://www.godaddy.com/help/setting-up-wildcard-dns-3301

    You may wish to contact them about this particular part.

    As for this though:

    Also, if I register a subdomain within my cpanel like I've done with test.gpcsite.com, I get an "Index of /" page (pictured in attachments).

    It doesn't look like it was pointed towards the root of your Multisite install, that would explain the "Index of /" page you're seeing right now.

    Please advise,
    Michael

  • Vaughan

    Hi David,

    Who are you hosting with?

    It sounds like possibly your A records are not configured correctly. or your host doesn't support wildcard subdomains either.

    Is the domain you are using your primary domain on your webhost account?

    You shouldn't create any subdomains in your CPanel for multisite as wordpress does the magic using URL rewriting which is why the wildcard is required.

    I would ask your webhost about this though because it doesn't seem like wordpress is the issue on this..

    But for confirming.

    Could you paste a copy of your htaccess & wp-config.php here (please remove the DB credentials before pasting)

    Thanks

  • David

    Two things:
    1) If my Wordpress install is in "public_html/" where should my wildcard point?
    2)I have not htaccess file, but...

    HERE IS THE COPIED WP-CONFIG FILE:

    <?php
    /**
     * The base configuration for WordPress
     *
     * The wp-config.php creation script uses this file during the
     * installation. You don't have to use the web site, you can
     * copy this file to "wp-config.php" and fill in the values.
     *
     * This file contains the following configurations:
     *
     * * MySQL settings
     * * Secret keys
     * * Database table prefix
     * * ABSPATH
     *
     * @link https://codex.wordpress.org/Editing_wp-config.php
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'XXXX');
    
    /** MySQL database username */
    define('DB_USER', 'XXXXX');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'XXXX');
    
    /** MySQL hostname */
    define('DB_HOST', 'XXXX');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'XXXX');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys and Salts.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY',         'ixh)fAM4R|um&9Ba*Ol8<;Gd# J/a?DWVo;DbXGd;JW$+<X05C|t-+H]fx4@%>tw');
    define('SECURE_AUTH_KEY',  'XXXXX^
    
    WwGpTF1tF[c<8xm%S66Z9ywa[ &qaAiW4 7o5BM-.<efE3) Y?s');
    define('LOGGED_IN_KEY',    'mIyVSa80xp k/n*~Z+>Yt?XgHDP4D$[eIW2CZPI,H3XNWLH29|7BoHXmLXydtrrU');
    define('NONCE_KEY',        'SG&)KrnXp2pyZFYsRi@!O,P7s$^TnV(MmbaO~T9X (ifRA_h7
    yMZWi;KZm#5DfR');
    define('AUTH_SALT',        '4Ed}Oxi4P|U{%t]bA+G,1E*&B2
    T|rzb+yb/y#|6k-v9xfc/+Ha4tPRkehi7:Of');
    define('SECURE_AUTH_SALT', 'n;>wCg9&:C<KO&Sq|{Cm%:h/SM&atOPcb+-@|+ni%^?btr_-zGY8^qF~dHO@QQ|D');
    define('LOGGED_IN_SALT',   ';w>/TxOZRNX!Hj$/^%Yj#-XRzoi@+-l}9 %Nc.b+p?[Po!8E^#jKlL]]33+QII{|');
    define('NONCE_SALT',       'X7OlCa52roPdK%u9DYY-<r+h-d:!5y@$4KugKI38~X GZwPD|
    [wIxZThG1K@qeb');
    /**#@-*/
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each
     * a unique prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'gpc_';
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     *
     * For information on other constants that can be used for debugging,
     * visit the Codex.
     *
     * @link https://codex.wordpress.org/Debugging_in_WordPress
     */
    define('WP_DEBUG', false);
    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'gpcsite.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    define( 'SUNRISE', 'on' );
    /* That's all, stop editing! Happy blogging. */
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
  • Vaughan

    Hi,

    your wildcard should point to the same folder as where your wp-config.php is, in your case, public_html

    As for htaccess, you will definitely have one, it's necessary.

    A lot of FTP clients have an option in the settings to hide/display hidden files beginning with a .

    If you're using CPanel filemanager, then check the options in the filemanager to make sure it's set to display files starting with a .

    Thanks

  • David

    My Host support rep at Servint shared the following with me:

    me: How do I set up a wildcard subdomain on gpcsite.com (*.gpcsite.com)?

    I'm trying to set up Wordpress Multi-User so I can create new accounts/sites from within Wordpress without having to log into cpanel to create a subdomain. I've tried to set up a wildcard domain up mutliple times using a few different methods, but I keep getting the same non-existent domain message (gpctest.gpcsite.com)
    Gabriel C:
    Hello
    Give me a moment while I take a look
    me: hi
    Gabriel C: Okay so I'm seeing the wildcard subdomain listed in cPanel/WHM
    Where are you seeing the error message? WordPress?
    me: Is it pointed to the same root as the wordpress installation?
    Gabriel C: Yes, I'm seeing wordpress installed into /public_html
    With it pointing with an A record towards 199.102.228.140
    me: Would there be any reason it would need to point towards 199.102.229.118?
    Thank you for your patience and help. I'm trying to cover every angle from each side of the problem. Wordpress is my next place to look.
    Gabriel C: There doesn't seem to be anything utilizing the 199.102.229.118 IP address
    me: Okay. Now for the fun question... "what am I not asking that I should be." lol
    Gabriel C: It's okay. Are you are only seeing the issue on WordPress?
    me: Wordpress creates the site/account, but when I visit the domain my browser shows me a "Website not available" message.
    You can see it here: gpctest.gpcsite.com
    Gabriel C: You created that subdomain through WordPress?
    me: Yes.
    Gabriel C: It would need a document root for it to lead anywhere, which is automatically created when the subdomain is made through cPanel
    Unfortunately I am unfamiliar with creating subdomains through WordPress
    me: I have a feeling the problem is in wordpress' rewrite rules. I'll get in touch with WPMUDEV. [smile]
    Gabriel, you've been very helpful. I'm hoping your information will be what puts this last project issue to bed. [smile]

  • Michael Bissett

    Hey @David, Michael here!

    I'm not seeing anything off within WordPress presently (based on what you've shared here), I'd like to have a closer look at your hosting provider's control panel, and dig into this further there. Could you please send in the following via our secure contact form:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include hosting control panel access details (login address, username & password)
    - Include any relevant URLs for your site

    IMPORTANT: Please make sure you select "I have a different question" for your topic, so it doesn't go back to the forums - this and the subject line ensure that it gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thanks a bunch! :slight_smile:

    Kind Regards,
    Michael

  • Michael Bissett

    Hey @David,

    Even after digging into your cPanel (and further checking WordPress, thanks for re-enabling the Support Access, by the way!), the cause of this still isn't wanting to reveal itself. But I do have an idea.

    Could you ask your host to reload the zone file for your site? It's not a common occurrence, but it is something that has come up as a reason for this sort of issue:

    https://wordpress.org/support/topic/multisite-subdomains-dont-load#post-4944713

    Please advise,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.