How do I fix my inability to access my sub-directory sites created by MultiSite?

Hello,
I installed Multisite. It forced me to pick a sub-directory structure (my site is not new).

I created my first subdirectory; however, when I try and access the dashboard for the newly created site, it sends me back a page, File Not Found. I am not sure what to do to enable me to create subdirectories and access them so I can start developing them.

When I first installed Multisite, I was going to select sub-domains, vice sub-directories. I understand that the lack of choice that it presented (made me select sub-directories) was due to my site being in existence for a period of time and possible permalinks conflicts. Based on what I read, sub-domains (my iPage hosting allows them) and sub-directories are pretty much equal. Is that correct?

If not, is there a way to change the settings to use sub-domains? And, if so, how might it affect my current pages, permalinks, etc...?

There are several managers available for domains, but none that I can find for sub-directories. Does one exist that would make it easier to work with sub-directories? Finally, I searched for documents that explain how to work with sub-directories (i.e., applying different themes, plugins, etc.....). Can you link me to a sub-directories for dummies guide? :slight_smile:

Thank you for your patience with my situation. In advance, thank you for your assistance.

Best wishes,
Randy

Randy Woolf
Sober Matters, LLC

  • Vaughan

    Hi Randy,

    I'm sure you should have been able to create a subdomain multisite, the permalinks wouldn't have been the issue, they're more an issue with subfolder sites, because the main site would be changed to use the /blogs/ suffix instead.

    Could you paste a copy of your htaccess & your wp-config.php (remove the DB credentials and Salt Keys)

    If you could also grant support access using the dashboard plugin so we can take a look. See https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Thanks

  • Randy

    Vaughn, thank you for the quick response. - keeping you busy today.

    Based on your comments, as you look at the files, can you change them from a sub-directory to a sub-domain setup. Or, let me know what I need to do to do so.

    Sending this first - now on to grant you access in the support config.

    ***************************HTACCESS FILE****************************

    # If you update your WordPress Permalinks the code between BEGIN WordPress and
    # END WordPress is replaced by WP htaccess code.
    # BEGIN WordPress

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /~sobermat/wordpress/
    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).*) home/sobermat/public_html/wordpress/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ home/sobermat/public_html/wordpress/$2 [L]
    RewriteRule . index.php [L]
    </IfModule>

    # END WordPress

    # BLOCK HOTLINKING TO IMAGES
    # To Test that your Hotlinking protection is working visit http://altlab.com/htaccess_tutorial.html
    #RewriteEngine On
    #RewriteCond %{HTTP_REFERER} !^https?://(www\.)?add-your-domain-here\.com [NC]
    #RewriteCond %{HTTP_REFERER} !^$
    #RewriteRule .*\.(jpeg|jpg|gif|bmp|png)$ - [F]

    # FORBID COMMENT SPAMMERS ACCESS TO YOUR wp-comments-post.php FILE
    # This is a better approach to blocking Comment Spammers so that you do not
    # accidentally block good traffic to your website. You can add additional
    # Comment Spammer IP addresses on a case by case basis below.
    # Searchable Database of known Comment Spammers http://www.stopforumspam.com/

    <FilesMatch "^(wp-comments-post\.php)">
    Order Allow,Deny
    Deny from 46.119.35.
    Deny from 46.119.45.
    Deny from 91.236.74.
    Deny from 93.182.147.
    Deny from 93.182.187.
    Deny from 94.27.72.
    Deny from 94.27.75.
    Deny from 94.27.76.
    Deny from 193.105.210.
    Deny from 195.43.128.
    Deny from 198.144.105.
    Deny from 199.15.234.
    Allow from all
    </FilesMatch>

    # BLOCK MORE BAD BOTS RIPPERS AND OFFLINE BROWSERS
    # If you would like to block more bad bots you can get a blacklist from
    # http://perishablepress.com/press/2007/06/28/ultimate-htaccess-blacklist/
    # You should monitor your site very closely for at least a week if you add a bad bots list
    # to see if any website traffic problems or other problems occur.
    # Copy and paste your bad bots user agent code list directly below.

    *********************************WP-CONFIG FILE****************
    <?php

    set_time_limit(120);

    /**
    * The base configurations of the WordPress.
    *
    * This file has the following configurations: MySQL settings, Table Prefix,
    * Secret Keys, WordPress Language, and ABSPATH. You can find more information
    * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
    * wp-config.php} Codex page. You can get the MySQL settings from your web host.
    *
    * This file is used by the wp-config.php creation script during the
    * installation. You don't have to use the web site, you can just copy this file
    * to "wp-config.php" and fill in the values.
    *
    * @package WordPress
    */
    define( 'PB_BACKUPBUDDY_MULTISITE_EXPERIMENT', true );

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */

    /** MySQL database username */

    /** MySQL database password */

    /** MySQL hostname */

    /** Database Charset to use in creating database tables. */

    /** 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
    */
    SALT KEYS REMOVED…..

    /**#@-*/

    /**
    * 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 = 'wp_pw_';

    /**
    * WordPress Localized Language, defaults to English.
    *
    * Change this to localize WordPress. A corresponding MO file for the chosen
    * language must be installed to wp-content/languages. For example, install
    * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
    * language support.
    */
    define('WPLANG', '');

    /**
    * 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.
    */
    define('WP_DEBUG', false);
    define( 'SUNRISE', 'on' );

    define( 'WP_MEMORY_LIMIT', '1024M' );

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', '198.154.243.239');
    define('PATH_CURRENT_SITE', '/~sobermat/wordpress/');
    define('SITE_ID_CURRENT_SITE', 1);

    /* 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');

  • Randy

    Vaughn, hello.
    Do hope your day is going well.

    Update: I revised my wp-config file for the following line changing the value from 'false' to 'true' (meaning subdomains). It now reads, "define('SUBDOMAIN_INSTALL', true);"

    I was looking in my admin panel for network settings to find the information to update my "htaccess" file for subdomains vice subdirectories. For the life of me, I cannot locate that information. I am pretty sure something needs to adjusted.

    FYI - good article I found on this is located at: http://www.elegantthemes.com/blog/resources/the-complete-guide-to-creating-a-wordpress-multisite-installation

    I looked through the related topics link list; however, did not find anything that addressed my issue.

    Finally, I created one sub-domain "Store" but it does not show up in any of the domain management plugins that I have. I am unsure why it would not show up. I created that subdomain using the CPanel tools for creating subdomains.

    To recap:
    1. What do I need to update in my htaccess file to allow for subdomains?
    2. Is there anything else that needs to be adjusted in my wp-config file?
    3. How do I get my subdomain site "Shop" to show up as a subdomain in my multisite subdomain management tools/plugins? - so I can manage those sites from their respective wordpress dashboards...
    4. Finally, having separate sites, I would like to do single-signon. Do you have a tool for that or suggestions?

    Thank you,
    Randy

  • Tedster

    Randy, I noticed right away in your .htaccess file,

    RewriteBase /~sobermat/wordpress/

    Please pardon me if I'm wrong but that tells me you did not move the WP files out of the /wordpress directory after unzipping them. Thus, your wordpress install is in a subdirectory, namely yoursite.com/wordpress/

    If you want to use subdomains, you would have to move the WP files into your home directory.

    Again, sorry if I'm seeing this wrong. I notice there is no directory of /sobermat/public_html or sobermat/htdocs, which typically would be your website's home directory. A typical case might have ~/sobermat/public_html/YOURWEBSITE or ~/sobermat/htdocs/YOURWEBSITE and the /wordpress directory would be empty. In fact, I always delete the /wordpress directory after a new install.

  • Randy

    Tedster, hello and thank you for your enlightening comments.

    Wow.... You are right on point. I had someone else install the wordpress for me - everything is going into the /wordpress sub-directory. As I am just getting this site going, I definitely want to fix it so I can use subdomains - have it set up correctly.

    When you say moved the files, I am thinking that there is a bit more effort than just moving them. Or, is it that easy?

    Thank you again for helping me get things straight.

    Best regards,
    Randy

  • Tedster

    I'm kind of an advanced newbie myself, so everything I say is just from my personal experience. That said, I would just re-install everything from scratch. When you activated sub-directories, that caused changes to files and the database. Maybe somebody more knowledgeable could chime in and tell you exactly what would need edited, but I wouldn't know where to start. Sorry I can't be of more help.

  • Jack Kitterhing

    Hi there @Randy,

    Hope you're well today! :slight_smile:

    Great job @Tedster, nice spot. :slight_smile:

    @Randy, If you don't already have anything else done, it's most likely easier to just delete and re-install in the root.

    If you do have the site already done and want to move it to the root, move all your files out of the /wordpress directory, so they are in your root directory and then run this script https://github.com/interconnectit/Search-Replace-DB to search and replace any instances of the old URL to the new url, as your old would be yourdomain.com/wordpress, your new one will just be yourdomain.com

    Thanks!

    Kind Regards
    Jack.

  • Randy

    All - thank you very much for all of your sage comments and observations. I sincerely appreciate your time and brain energy.

    Based on your comments, I wiped everything and reinstalled Wordpress and enabling it for multisite with sub-domains. Everything is working beautifully.

    My hope is that my experience and your comments will be of use to others in avoiding the same issues.

    All thumbs up!!!!! I will not hesitate to recommend you all to others.......
    Randy

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.