• Hello to all,

    I am trying to set up a multisite network on my WordPress installation which is being used as a separate section in my Magento store.

    WordPress is installed in the root/wordpress directory and I have set up the WordPress Address(URL) to be domain.com/wordpress and the Site Address(URL) to be domain.com/blog.

    I have also installed the Magento WordPress Integration(Magento extension to integrate WordPress as a blog in the shop) and have set it up so that people can use WordPress as a page inside the shop, accessible through the URL domain.com/blog.

    The /blog directory does not exist on the server. I do not have a .htaccess file in my /wordpress directory, only the regular Magento one in the root.

    When I set up the permalinks to a custom structure, I got this message – “If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file.”

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    I did not put this anywhere, cause the blog was working as expected, the WP admin was working as well. The .htaccess file on the root is writable, btw.

    The problems appeared when I tried to set up a multisite network. As advised in the tutorial, I added this line in the wp-config.php

    define( 'WP_ALLOW_MULTISITE', true );

    and then I followed the instructions in the admin.

    It says the following: I should add this to the wp-config.php:

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'www.domain.com');
    define('PATH_CURRENT_SITE', '/blog/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    And the following to the .htaccess:

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

    but it tells me to put this in a .htaccess file inside the /blog directory, which I have never created. Because if I had put wordpress in a /blog directory, then the Magento extension would not have been able to integrate wordpress via the domain.com/blog URL, cause that URL would have opened the WordPress blog, not a page in Magento.

    When I create the /blog directory and put this in a .htaccess file inside, I cannot log in to wordpress admin, it just does not log in, it adds some redirect_to= parameters and a reauth=1 at the end.

    So, my question is – what did I do wrong? Should I put the permalinks code in some .htaccess. should I change something in the suggested .htaccess by the Network installation wizard or should I change my directory structure?

    I do not have a clue at the moment.

    Any helpful feedback will be much appreciated. Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    This is a pretty general ‘Running WordPress out of it’s own folder’ kind of thing. First of all, you MUST get normal WP up and running like this first! If you try to do Multisite and THEN move it around, you will cry.

    WordPress is installed in the root/wordpress directory and I have set up the WordPress Address(URL) to be domain.com/wordpress and the Site Address(URL) to be domain.com/blog.

    Why not install WP in /blog ? This will save you miles of pain.

    Thread Starter robert_neto

    (@robert_neto)

    Why not install WP in /blog ? This will save you miles of pain.

    Because if I do that, when users navigate to domain.com/blog they would access the regular wordpress blog, instead of the integrated wordpress page in Magento, which the Integration extension offers.

    I managed to fix this issue, I changed the Site Url to the root folder instead of the blog one, and it works.

    However, I now have other problems with the multisite extension. Should I write about them here or should I open another thread?

    Thanks

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    There’s no ‘multisite extension’ in WP… And what you’re doing isn’t supported so you’re in a brave new world for yourself 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cannot log in to admin after setting up a Network’ is closed to new replies.