I will best explain this by showing an example
subsite URL: (site uses sub-directories)
/
correct/actual uploaded file URL:
/...
current upload file URL: (what WP is currently using)
/...
Why is WP adding the sub-directory of the subsite in a URL that is supposed to be for an uploaded file? WP uploads the files correctly, but then in both the media area and included in a post/page the URL is incorrect.
The files do indeed get uploaded to their correct location.
Things I've tried:
I was able to fix this temporarily on a site by including a redirect in my DNS, but this solution is far from universal and still doesn't actually fix the problem.
I have also set the "upload path" and "upload url path" in the network admin area for the individual site
The file and directory permission are correct
disabling all plugins also changed nothing
Using a standard theme (2019) change nothing
Further inspection:
The file URL change is happening for all included local files (css, js, etc), but these other files fork fine. They load, I can access them with and without the added subsite sub-directory.
Solution: (for now) I moved the entire uploads folder to the default location.
I will best explain this by showing an example
subsite URL: (site uses sub-directories)
https://domain/sub1/
correct/actual uploaded file URL:
https://domain/uploads/sites/1/2019/08/...
current upload file URL: (what WP is currently using)
https://domain/sub1/uploads/sites/1/2019/08/...
Why is WP adding the sub-directory of the subsite in a URL that is supposed to be for an uploaded file? WP uploads the files correctly, but then in both the media area and included in a post/page the URL is incorrect.
The files do indeed get uploaded to their correct location.
Things I've tried:
I was able to fix this temporarily on a site by including a redirect in my DNS, but this solution is far from universal and still doesn't actually fix the problem.
I have also set the "upload path" and "upload url path" in the network admin area for the individual site
The file and directory permission are correct
disabling all plugins also changed nothing
Using a standard theme (2019) change nothing
Further inspection:
The file URL change is happening for all included local files (css, js, etc), but these other files fork fine. They load, I can access them with and without the added subsite sub-directory.
Solution: (for now) I moved the entire uploads folder to the default location.
Share Improve this question edited Aug 9, 2019 at 17:39 KnightHawk0811 asked Aug 9, 2019 at 16:59 KnightHawk0811KnightHawk0811 3322 silver badges12 bronze badges1 Answer
Reset to default 0I moved the entire uploads directory to the default location.
Not sure exactly why a standard WP install can easily move the uploads folder but a multisite install causes this problem, but there it is. I removed the line in the wp-config file and also moved the directory on the server.