WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multisite subfolders - can't access URLs containing wp-content on subsites (11 posts)

  1. Looic
    Member
    Posted 1 year ago #

    Hi All,
    I migrated an existing WordPress install to Multisite using subfolders.

    - The wordpress is installed in /wp/
    - The main site is accessible from http://www.ikeaddict.com and for SEO purpose, it redirects to http://www.ikeaddict.com/la-communaute-des-ikea-addicts
    - My admin panel is accessible to http://www.ikeaddict.com/wp/wp-admin/

    So the mainsite and the admin panel work perfectly !

    - One subsite I created for testint purpose is at the following address, which is what I want :
    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/new/

    The problem is that all addresses that contain wp-content (and probably wp-includes, wp-admin) redirect to the main website instead of distributing the right file.

    See an example :
    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/new/wp-content/themes/twentytwelve/style.css

    So here is my wp-config.php :

    /* Multisite */
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    //$base = '/';
    define('DOMAIN_CURRENT_SITE', 'www.ikeaddict.com');
    define('PATH_CURRENT_SITE', '/la-communaute-des-ikea-addicts/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    And the .htaccess which resides in / :

    RewriteEngine On
    RewriteBase /
    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).*) wp/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]
    RewriteRule . index.php [L]

    Do you have an idea on what is going wrong with this configuration ?
    Thank you for your help,

    Best regards,
    Looic.

  2. My admin panel is accessible to http://www.ikeaddict.com/wp/wp-admin/

    So you're running WP out of it's own folder?

    In the .htaccess, change RewriteBase / to be

    RewriteBase /wp/

    (in all my tests, WP picks that up right away)

  3. Looic
    Member
    Posted 1 year ago #

    Yes wp is installed in a specific folder : /wp

    and all my websites have the following prefix :
    /la-communaute-des-ikea-addicts

    Adding ReweriteBase /wp or /wp/ in the .htaccess doesn't work and makes a redirection loop when trying to access subsites.

    Any other idea ? This is a very compliated issue :-(

    Thank you,
    Looic.

  4. creativepublishing
    Member
    Posted 1 year ago #

    this sounds like a wonderful question for stackoverflow. This is a bit of a complicated htaccess rule and there are a lot of great programmer over at the stack.

  5. And there aren't here, creativepublishing? :) You probably didn't mean that to be an insult, but gosh it felt that way for a second.

    define('PATH_CURRENT_SITE', '/la-communaute-des-ikea-addicts/');

    ...

    Okay let's step back to make sure we're on the same page:

    In what folder is WP installed?

    What is the URL of your main site?

  6. Looic
    Member
    Posted 1 year ago #

    Ok so:

    - The WordPress (3.5) is installed in /wp/
    - I want the site to be reachable by http://www.ikeaddict.com.
    - I want all my sites (main and subsites) to be under :

    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/
    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/subsite1
    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/subsite2
    ...

    As you can see, articles from the main site are at :
    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/4598/sapin-de-noel-ikea-a-6-euros-avec-loperation-agir-a-la-racine/

    and the admin panel works very well.

    And when I want to go on a subsite admin panel, for example to create a new post, I got a redirection loop:
    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/new20/wp-admin/post-new.php

    [Sun Dec 23 11:47:19 2012] [error] [client 82.247.240.114] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3112): [client 82.247.240.114] r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /wp/new20/wp-admin/post-new.php
    [Sun Dec 23 11:47:19 2012] [debug] core.c(3118): [client 82.247.240.114] redirected from r->uri = /la-communaute-des-ikea-addicts/new20/wp-admin/post-new.php

    Also the subsite "new20" loads but without css and js content :
    http://www.ikeaddict.com/la-communaute-des-ikea-addicts/new20/

    Do you have an idea ?

    :)

    Loic.

  7. The WordPress (3.5) is installed in /wp/
    - I want the site to be reachable by http://www.ikeaddict.com.

    Okay. There are a couple things going on here that are going to screw up Multisite.

    To get WP to run from it's own folder, you have to install WordPress at http://www.ikeaddict.com/wp/ and BEFORE you set up Multisite, change the site to run from WP, but act like it's in http://www.ikeaddict.com/

    Presuming you did that, you won't be able to 'redirect' it to http://www.ikeaddict.com/la-communaute-des-ikea-addicts

    If you WANT the site to run from http://www.ikeaddict.com/la-communaute-des-ikea-addicts then you have to install it there. It's just not going to work other other ways because of how Multisite processes things. Even if you tried redirecting, you'd run into processing issues with the other sites. Registration and login would get slaughtered.

    So here are some questions to find a work around :)

    What "SEO purposes" are forcing this redirect?

    Can we do it the other way and direct everything from http://www.ikeaddict.com/la-communaute-des-ikea-addicts back to http://www.ikeaddict.com/ instead?

    What about making http://www.ikeaddict.com/la-communaute-des-ikea-addicts a subsite from http://www.ikeaddict.com/ and keeping the main domain as a 'landing page'?

  8. Looic
    Member
    Posted 1 year ago #

    Thank you for your answer.

    I thought what I described was possible with WP 3.5.

    No matter, I will try to make it work with some redirections rules.

    Thank you again,
    Loic.

  9. It is possible, but you have to set it up in the correct order :) You put your socks on before your shoes, after all. Same with this.

    1) install WP
    2) Set it up to 'run in it's own folder'
    3) Enable multiple.

  10. Looic
    Member
    Posted 1 year ago #

    I finally found a solution to have my WP 3.5 multisite installed into /wp/ AND all my sites located under /la-communaute-des-ikea-addicts/

    RewriteRule ^la-communaute-des-ikea-addicts/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
    RewriteRule ^la-communaute-des-ikea-addicts/([_0-9a-zA-Z-]+/)?(.*\.php)$ wp/$2 [L]

    I was first very very surprised but after doing some tests, it seems to work like a charm !

    Thank you for all your answers,
    Loic.

  11. caltuna123
    Member
    Posted 1 year ago #

    This is a related question.

    I installed WP in http://www.xxxx.com/somename

    I made it multisite. Works fine.

    Now I don't want "somename" but want "name-1" for the first site. Later sites will be "name-2", "name-3". They have not yet been created.

    Can I just go into the site via FTP and change the "somename" directory to "name-1"? I don't think so but I wanted to ask. If it is even possible at this time to make the change how would I do it. Change .htaccess and wp-config too? They are the only places I've seen "somename".

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.