• Resolved virre12

    (@virre12)


    I have a WP multsite on my Nginx server. I have got my WP install in its own little directory/web
    It’s working, I can access wp-admin on example.com/web/wp-admin/ and the network panel example.com/web/wp-admin/network/. I can create more sites ex. example.com/test-site
    But no styles or pictures loads. They link to example.com/test/wp-includes/css/ witch should beexample.com/web/test/wp-includes/css/

    I can’t either access the admin panel of other sites, It says page isn redirecting properly
    ex example.com/test-site/wp-admin

    I have looked here at the support forums but I could not find an answer for a Nginx-server.
    Here are my configs:

    Nginx config:

    server{
    listen 80;
    server_name example.com;
    root /home/public_html/;
    index index.php index.html; 
    
    location / {
    try_files $uri $uri/ /index.php?$args ;
    }
    
    location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    	fastcgi_read_timeout 120;
    }
    
    location ~ /\. { deny  all; access_log off; log_not_found off; }
    location = /robots.txt { access_log off; log_not_found off; }
    
    }

    Wp-config

    // ** MySQL-inställningar - MySQL-uppgifter får du från ditt webbhotell ** //
    /** Namnet på databasen du vill använda för WordPress */
    define('DB_NAME', 'DATABASE');
    
    /** MySQL-databasens användarnamn */
    define('DB_USER', 'USER');
    
    /** MySQL-databasens lösenord */
    define('DB_PASSWORD', 'PASSWORD');
    
    /** MySQL-server */
    define('DB_HOST', 'localhost');
    
    /** Teckenkodning för tabellerna i databasen. */
    define('DB_CHARSET', 'utf8');
    
    /** Kollationeringstyp för databasen. Ändra inte om du är osäker. */
    define('DB_COLLATE', '');
    
    define('AUTH_KEY',         'MY KEYS HERE');
    define('SECURE_AUTH_KEY',  'MY KEYS HERE');
    define('LOGGED_IN_KEY',    'MY KEYS HERE');
    define('NONCE_KEY',        'MY KEYS HERE');
    define('AUTH_SALT',        'MY KEYS HERE');
    define('SECURE_AUTH_SALT', 'MY KEYS HERE');
    define('LOGGED_IN_SALT',   'MY KEYS HERE');
    define('NONCE_SALT',       'MY KEYS HERE');
    
    $table_prefix  = '_';
    
    define('WP_DEBUG', false);
    
    /* Multisite settings */
    define( 'WP_ALLOW_MULTISITE', true );
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'EXAMPLE.COM');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    
    /* Det var allt, sluta redigera här! Blogga på. */
    
    /** Absoluta sökväg till WordPress-katalogen. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Anger WordPress-värden och inkluderade filer. */
    require_once(ABSPATH . 'wp-settings.php');

    How can I fix this problem?

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

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    But no styles or pictures loads. They link to example.com/test/wp-includes/css/ witch should beexample.com/web/test/wp-includes/css/

    No, they should be example.com/test/wp-includes/css/ (seriously that’s correct).

    I don’t see any nginx rules for WP … like:

    if (!-e $request_filename) {
    		rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    		rewrite ^(/[^/]+)?(/wp-.*) $2 last;
    		rewrite ^(/[^/]+)?(/.*\.php) $2 last;
    	}
    Thread Starter virre12

    (@virre12)

    Thank you very much. Now my multi-site works!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress multisite 404error on Nginx’ is closed to new replies.