Support » Networking WordPress » ms-files.php and other nginx or htaccess rewrites

  • PD

    (@peterdowney01)


    Can anyone help me to understand the correct settings that multi sites currently need? I’ve read that ms-files.php and blogs.Dir are no longer needed or used in WordPress. Is that correct or am I misunderstanding something?

    If so, what are the up to date rewrite rules for a fresh WordPress multi site install? Ideally I’d love to see the nginx rules. Everywhere I look I see references to ms-files, but is that out of date information?

    WordPress also stores uploads in a different location now than most tutorials show. Uploads are no longer stored in the /files directory.

    Finally, can anyone share a working bit of code for nginx map using a fresh WordPress multi site installation with subdirectories. All map codes I’ve seen specify a depreciated uploads location and I’m having some trouble understanding the regular expressions needed to correct it.

    For reference, here is the code directly from the WordPress codex, it all appears incorrect. Note the calls to the depreciated /files/ and blogs.dir directories and ms-files.php. a fresh WordPress install just simply doesn’t use those directories.

    location ~ ^/files/(.*)$ {
              try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-files.php?file=$1 ;
              access_log off; log_not_found off; expires max;
     }
Viewing 1 replies (of 1 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I’ve read that ms-files.php and blogs.Dir are no longer needed or used in WordPress. Is that correct or am I misunderstanding something?

    For NEW Multisite networks created post WordPress 3.5, this is correct.

    If so, what are the up to date rewrite rules for a fresh WordPress multi site install?

    They show up when you configure Multisite. That is, your install literally will say “Copy this into your .htaccess…” or nginx.conf. I think it can still do that too.

    The codex is likely out of date because not enough people use nginx yet to be on the ball with updating it. :/

Viewing 1 replies (of 1 total)
  • The topic ‘ms-files.php and other nginx or htaccess rewrites’ is closed to new replies.