WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] XAMPP Local Windows 7 Multisite Install With Subdirectories Getting 404 errors (12 posts)

  1. jcaynes
    Member
    Posted 2 years ago #

    I have four local WordPress installations with XAMPP. All function well except for the multisite, which is showing 404 errors when clicking on pages and Subdirectory blogs.

    httpd.conf:
    #LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule setenvif_module modules/mod_setenvif.so

    wpconfig.php:
    define('WP_DEBUG', false);

    define('WP_ALLOW_MULTISITE',true);

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.parceledgardens.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    /* That's all, stop editing! Happy blogging. */

    .htaccess, located on root directory:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    I'm really not sure about the .htaccess file. My working .htaccess file on the server where my website is live works, but I deleted a lot of it for the local install because I am completely redesigning the site and may not need all the rules... And it didn't work locally anyway.

    Uninstalled, reinstalled. Deleted and recreated database. Same issues. I'm sure I'm missing something, I just don't see it here. The other three blogs don't have an .htaccess file.

  2. .htaccess is okay for a subfolder install.

    The other three blogs don't have an .htaccess file.

    You didn't make phsyical folders for these sites? Right? You got that they're virtual?

    Double check that your httpd.con (or whatever that is on IIS) has AllowOverride set to all?

  3. jcaynes
    Member
    Posted 2 years ago #

    Hi Ipstenu, I think I should have clarified that I have four working sites under development with XAMPP. ParceledGardens is the only multi site. The other three sites are fine, the multi site is not. When I referenced the other three blogs, it was regarding the three other wordpress sites and not subdirectories of ParceledGardens.

    My host file and httpd.conf file is set, as the other three XAMPP sites are working properly:

    # localhost name resolution is handled within DNS itself.
    # 127.0.0.1 localhost
    # ::1 localhost

    127.0.0.1 localhost
    127.0.0.1 http://www.analyticallyspeaking.com
    127.0.0.1 http://www.parceledgardens.com
    127.0.0.1 http://www.jancaynes.com
    127.0.0.1 http://www.organically.us
    127.0.0.1 http://www.theartisanjewelry.com

    <VirtualHost *:80>
    DocumentRoot "D:\xampp\htdocs"
    ServerName localhost
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin think@analyticallyspeaking.com
    DocumentRoot D:\_analytic
    ServerName http://www.analyticallyspeaking.com

    <Directory "D:\_analytic">
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin findme@theartisanjewelry.com
    DocumentRoot D:\_artisan
    ServerName http://www.theartisanjewelry.com

    <Directory "D:\_artisan">
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin im@jancaynes.com
    DocumentRoot D:\_jcaynes
    ServerName http://www.jancaynes.com

    <Directory "D:\_jcaynes">
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin live@organically.us
    DocumentRoot D:\_organic
    ServerName http://www.organically.us

    <Directory "D:\_organic">
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin plantme@parceledgardens.com
    DocumentRoot D:\_pgardens
    ServerName http://www.parceledgardens.com

    <Directory "D:\_pgardens">
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    All the other information is as provided earlier. I'm pretty sure the .htaccess is borked somehow, but can't put my finger on it.

  4. jcaynes
    Member
    Posted 2 years ago #

    The httpd.conf file information was provided earlier, the other virtual host information is from my httpd-vhosts.conf file. Just to keep us on the same page :)

  5. ParceledGardens is the only multi site.

    Note: The .htaccess for a Multisite has different requirements than singlesite. Do go back and make sure AllowOverride is set to ALL for that domain.

  6. jcaynes
    Member
    Posted 2 years ago #

    Hi Ipstenu,

    There are three places for this in the httpd.conf file, so it's a bit confusing. I'm listing each as they appear and commented text for context of the use.

    Why would this affect only a multisite?

    First:
    ServerName localhost:80

    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "D:/xampp/htdocs"

    #
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    #
    # First, we configure the "default" to be a very restrictive set of
    # features.
    #
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>

    Second:
    <Directory "D:/xampp/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    Third:
    # "D:/xampp/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "D:/xampp/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    </Directory>

    Thanks for your assistance!

  7. Why would this affect only a multisite?

    tl;dr: The .htaccess is more complex.

    I'd change this:

    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>
  8. jcaynes
    Member
    Posted 2 years ago #

    Thank you, Ipstenu,

    Change it to allow from all? Or AllowOverride Yes? I'm not clear on this.

    I was wondering why these things would be different for a multisite, but you were referencing the .htaccess file?

    Thanks for your time.

  9. All. AllowOverride ALL.

    Like I said:

    Note: The .htaccess for a Multisite has different requirements than singlesite. Do go back and make sure AllowOverride is set to ALL for that domain.

  10. jcaynes
    Member
    Posted 2 years ago #

    Ipstenu,

    I know you aren't getting paid to review my questions and respond to them. I'm sure your time is very valuable. I am simply trying to clarify answers so that they don't seem like vague responses to me.

    I understand the .htaccess file is different for a multisite.I am not clear how the httpd and override issues are handled differently from a multisite and single site and why the single sites without an .htaccess file works, but the one site with the same settings and a multisite .htaccess file does not. It seems odd. I'm trying to understand the logic.

    As for the .htaccess file, I copied it from one of your multisite posts that identified what a complete .htaccess file is for a multisite. So, all but multisite working is quite perplexing.

    If you'd like to take a break from my posts, I'm fine to wait for someone else to answer.

    Thanks.

  11. jcaynes
    Member
    Posted 2 years ago #

    Ipstenu,

    Thank you for the clarification. The change was made, computer and XAMPP restarted and the issue is resolved.

    I appreciate your assistance, but still don't understand why it's handled differently.

    Thanks.

  12. The reason I didn't stop to explain is I want to get you FIXED first. Then we can get into why and wherefore :) Support first, then we can make sure I didn't waste your time with a wrong path (imagine, if I'd spent a very long post explaining stuff that was wrong? You may be okay with it, but most people get pissed off. So we fix, then go back.)

    If you take a close look at the .htaccess for 'normal' WordPress and Multisite, you'll see a lot of differences, right?

    If you use subdomains you have this new line:
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    Subdirectories looks like
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    Now that is a double redirect. It sends you from /files/whatever to /wp-includes/ms-files.php?file=whatever and THEN to /wp-content/blogs.dir/SITEID/files/whatever

    That ms-files.php bit is the part that requires AllowOverride to ALL.

    To quote Apache:

    When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files.

    Basically by default, .htaccess does NOT like you to use PHP files like that. They don't like this idea of a redirect to a file that parses and redirects silently. This happens more often with other apps out there (Gallery 3 comes to mind), but generally the more complicated your .htaccess rules, the more likely this is to occur, because the more permissions needed to parse rules.

Topic Closed

This topic has been closed to new replies.

About this Topic