WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multisite Admin Panel 'edit post' and other buttons links not valid (27 posts)

  1. bossbowser
    Member
    Posted 4 months ago #

    As always thanks in advance if you can help.

    I'm seeing a very weird issue with a multisite. Currently it has the following multisites setup:

    http://www.domain.com
    http://www.domain.com/london/
    http://www.domain.com/paris/
    http://www.domain.com/berlin/
    Each subdirectory site uses a different child theme (containing a few changes to css in each) of http://www.domain.com overiding theme.

    The network sites each have the setup options for Siteurl and Home, which each reflect the setup of:

    Siteurl:www.domain.com
    Home:www.domain.com/london/
    This works fine, but BREAKS the backend navigation for the /london/ website trying to force some wordpress links (edit post, update post, catagory creation, publish post etc) as http://www.domain.com/wp-admin/... rather than http://www.domain.com/london/wp-admin/...

    I changed the network setup of each website to the equivalent of:

    Siteurl:www.domain.com/london/
    Home:www.domain.com/london/
    This fixes the navigation for the backend of http://www.domain.com/london/wp-admin but breaks all path files for calling anything from the parent theme and breaks all css/images in the backend of wordpress.

    Can anyone advise a way to move forward?

    This is driving me crazy! Anyone else seen anything like this before?

  2. Currently it has the following multisites setup:

    http://www.domain.com
    http://www.domain.com/london/
    http://www.domain.com/paris/
    http://www.domain.com/berlin/

    You mean you have FOUR multisites, or that domain.com is a multisite, and london, paris, and berlin are sites on the network?

  3. bossbowser
    Member
    Posted 4 months ago #

    Apologies, I meant that http://www.domain.com is the multisite, and London, Paris, and Berlin are sites on the network. Please advise.

  4. Right :) Makes a difference ;)

    I changed the network setup of each website to the equivalent of:

    Siteurl:www.domain.com/london/
    Home:www.domain.com/london/

    I'm assuming you did this on a page like /wp-admin/network/site-info.php?id=5 ?

  5. bossbowser
    Member
    Posted 4 months ago #

    Yes in the settings tab.

  6. bossbowser
    Member
    Posted 4 months ago #

    That then breaks the back end and the front end as the all paths are the equivalent to http://www.domain.com/london/wp-content/themes/cluboid/images/scroll-top.gif.

    But interestingly the backend 'edit posts' and other such buttons work.

    I know I could copy wp-content into a london directory on the server to fix this issue, but surely this defeats the point of child themes and multisite!?

  7. bossbowser
    Member
    Posted 4 months ago #

    Also I just tried to create a new site a moment ago just to test it. With the site address as http://www.domain.com/newsite with the user set to my superadmin. It creates it no issue, but then when I then go to this sites dashboard any file wordpress tries to call eg css, javascript etc is a 404 in the console of chrome due to wordpress trying to find files in `http://www.domain.com/birmingham/wp-admin/css/colors.min.css?ver=3.8.1
    Failed to load resource: the server responded with a status of 404 (Not Found) `

  8. bossbowser
    Member
    Posted 4 months ago #

    I've also come across this online which seems to be the same problem I'm encountering http://premium.wpmudev.org/forums/topic/network-admin-menu-links-broken-upon-35-subdomain-multisite-install-subfolder-wp-install

  9. You're not supposed to edit things there. It messes the process up as you've just found out. Basically WP doesn't know what it is anymore.

    However the bigger thing is that you totally did it wrong in the first place.

    On /wp-admin/network/site-info.php?id=5 on the EDIT tab, I see this:

    https://cloudup.com/cR7KLMaQWyf

    THAT is what it's supposed to look like. You want it to say london? You change that to london. You do not, under any circumstances, go into the "Settings" tab and edit it there, because THAT is a super advanced, please don't mess with it unless you understand how to repair databases, section.

    Home and site URLs should be http://example.com/london/ HOWEVER you do not change it in the back end of settings. You change it in the edit tab.

  10. bossbowser
    Member
    Posted 4 months ago #

    Hi Mika,

    After taking your advice I completely wiped the server starting afresh following the install step by step.

    On the creation of each site on the options I did as you told me and did not change the settings tab, just in the edit tab setting the path to /london/ and hey presto! It's still the same issue.

    The wordpress backend for london is still 404'ing it's own files looking in http://www.domain.com/london/wp-includes/js/filename

    This is driving me crazy. Of course I could just create a subfolder on the server and put in the files it's trying to pull in but surely this would defeat the point of one install???

    I appreciate your help thus far.

  11. bossbowser
    Member
    Posted 4 months ago #

    You can see here what I'm referring to in regards to broken links on these two screen shots

    http://s29.postimg.org/alhukxhk7/image.jpg

    http://s22.postimg.org/qe7qwo3kx/debug.jpg

    As mentioned above, we've followed the setup step by step, and have multisite setups on other projects (although in subdomain format). Even for highly skilled php programmers we cannot see why this would be?!

  12. jkhongusc
    Member
    Posted 4 months ago #

    Can you show us your .htaccess and custom definitions in wp-config.php? My guess is an .htaccess problem.

  13. bossbowser
    Member
    Posted 4 months ago #

    # BEGIN WordPress
    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]
    # END WordPress

  14. bossbowser
    Member
    Posted 4 months ago #

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

  15. jkhongusc
    Member
    Posted 4 months ago #

    Your .htaccess is slightly different than mine. The lines that are different affect the 404 urls you see. I got my setting from the WP page - http://www.domain.com/wp-admin/network/setup.php

    My .htaccess looks like this:

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

    You may want to try my .htaccess on your system. If you do remember to backup your current ones. My bet is that this will fix your 404s... hopefully =)

  16. So what I told you was the right way to edit it.

    On the creation of each site on the options I did as you told me and did not change the settings tab, just in the edit tab setting the path to /london/ and hey presto! It's still the same issue.

    Here's the real question. Why do you need to do this at all?

    Look, if I want a site named london, I make a site named london and I leave it the heck alone! There's no logical reason to rename a site.

    The wordpress backend for london is still 404'ing it's own files looking in http://www.domain.com/london/wp-includes/js/filename

    That's where it's supposed to look!

    jkhongusc's htaccess is correct, by the way. Yours is an older version.

  17. bossbowser
    Member
    Posted 4 months ago #

    Here's the real question. Why do you need to do this at all?

    Look, if I want a site named london, I make a site named london and I leave it the heck alone! There's no logical reason to rename a site.

    The reason for this is we are representing capital cities around the world and each will be geotargeted through google webmaster.

    That's where it's supposed to look!

    Surely this is just WordPress creating 'virtual' paths? Rather than placing and requiring the files from there. I just can't see how the following debug gives a 404 (http://s22.postimg.org/qe7qwo3kx/debug.jpg) when you say it's meant to be looking there?

    I replaced the htaccess file with the one supplied by jkhongusc. I still have the same issue.

    Has anyone come across this issue before?

  18. jkhongusc
    Member
    Posted 4 months ago #

    > I replaced the htaccess file with the one supplied by jkhongusc. I still have the same issue.

    Are you sure your web server is configured to allow htaccess files. You are having a rewrite problem. Those rules are in the htaccess file. The easiest way to check if htaccess is enabled is putting junk at the very top like this:

    # the next line will cause a 500 error in your browser
    this will break htaccess
    
    <rest of htaccess config>

    BTW, you do not show what the 404 errors look like. That is important because it could come from your web server or from WP. If the 404 comes from the web server, I am almost certain it is an htaccess issue. If it comes from WP, then it is a WP config issue.

  19. bossbowser
    Member
    Posted 4 months ago #

    Are you sure your web server is configured to allow htaccess files. You are having a rewrite problem. Those rules are in the htaccess file. The easiest way to check if htaccess is enabled is putting junk at the very top

    Indeed that does break the .htaccess and supplies a 500 server error so we can be sure that .htaccess is being read by the server.

    You can see here how weird and frustrating this problem is!

  20. jkhongusc
    Member
    Posted 4 months ago #

    Ah, you are using nginx! As I understand it, nginx does not support htaccess file... is that true? You have to convert the WP .htaccess to nginx rules.

  21. The reason for this is we are representing capital cities around the world and each will be geotargeted through google webmaster.

    But ... but why not just make the SITE with the slug of /london/

    Why are you EDITING it at all. That's what makes no sense at all to me :)

    (And yeah, nginx uses a conf file, not .htaccess)

  22. bossbowser
    Member
    Posted 4 months ago #

    Mika, to be clear are you suggesting a seperate wordpress install for each capital city; Or something different?

    http://www.domain.com/london
    http://www.domain.com/berlin
    http://www.domain.com/paris
    etc...? Am I missing something very very simple here?

    The reason we must use a multisite setup is that each post MUST have the permalink setup for seo reasons of something like http://www.domain.com/london/clubs/post-name - http://www.domain.com/paris/clubs/post-name - http://www.domain.com/berlin/post-name

    All of which must be subdirectory so that link juice flows through the entire domain.

    I'm looking into whether our server is running NGINX now...

  23. jkhongusc
    Member
    Posted 4 months ago #

    > I'm looking into whether our server is running NGINX now...

    You are running nginx 1.4.1. I know because I am psychic ;)

    That is the root of your problems. You are following the Apache configuration (e.g. htaccess) when you need to follow the nginx instructions - http://codex.wordpress.org/Nginx

    Later you started editing the Siteurl because it looked like it "fixed" some things. Fix nginx config first. You should not need to edit siteurl.

  24. Mika, to be clear are you suggesting a seperate wordpress install for each capital city; Or something different?

    http://www.domain.com/london
    http://www.domain.com/berlin
    http://www.domain.com/paris

    No! NOT AT ALL!

    I'm saying with Multisite, when you make a new SITE on the network, you pick the name right there! So if I want to install a new site named 'london' on domain.com, I name the site london. There's never any need to 'rename' a single thing! That's why you're totally breaking my brain here :)

    Am I missing something very very simple here?

    Possible, so let me ask this one last time. If you don't answer this one, I'm giving up.

    WHY are you renaming a site on your network at all, when you have a clean install of WP?

    Seriously, there's no reason I can fathom why you'd do that. It's like telling the car dealer "I want a red car" and then the first thing you do is paint the car blue. Why not just start with blue?

    And no, your answer is not "So I can have these URLs" because that isn't what I'm asking. I'm asking "If you want london as the URL, why didn't you just name the site london to begin with?"

  25. bossbowser
    Member
    Posted 4 months ago #

    WHY are you renaming a site on your network at all, when you have a clean install of WP?

    Originally when we came across the problem after some research w then went into the settings and changed the siteurl and home. However as we have both seen this did not work.

    After you advised TO NOT change anything in the settings I wiped the server and all databases and started from fresh.

    Now all sites are created and named via the 'Add a new site' section in the backend and given the site title and nothing changed in the settings. To confirm I am NOT renaming the site in the settings since you first pointed out this will cause issues.

    Unfortunately it does not appear that our server is running NGINX but just to double check I'm awaiting our hosting guys to go over this.

    I appreciate everyone helping so far. This is driving me crazy, and in all my years of using the trusty steed that is wordpress I have never had an issue like this go on so long!

  26. bossbowser
    Member
    Posted 4 months ago #

    Ok we've got to the bottom of the issue.

    The server was running NGINX the whole time thus the .htaccess rewrite rules were simply not being taken into account breaking the backend virtual paths!

    Many many thanks to both Ipstenu and jkhongusc for their patience and expertise.

    IF YOU'RE READING THIS SEARCHING FOR ANSWERS PLEASE CHECK WITH YOUR HOSTING PROVIDER IF YOU ARE RUNNING NGINX!

  27. bossbowser
    Member
    Posted 4 months ago #

    Resolved

Reply

You must log in to post.

About this Topic

Tags