內容簡介
預設情況下,WordPress Multisite 在檔案上傳時會使用某些重寫規則,這會導致 URL 不反映伺服器上檔案的確切位置。這個外掛程式會停用此功能。
注意:這個外掛程式的目的非常簡單。在大多數 Multisite 網路中使用它之前,需要進行額外的設定。
如果您的 Multisite 最初是使用 WordPress 3.5 或更新版本建立的,則不需要此外掛程式。
使用前
這個外掛程式的用途非常明確。要使用它,您需要先完成某些步驟:
將您的圖像從 /wp-content/blogs.dir/SITENUM/files/ 移動到 /wp-content/uploads/sites/SITENUM/。其中SITENUM對應於每個子網站的 ID。
修改每個網站的資料庫。我建議使用 這個很棒的指令稿 (完成後不要忘記刪除它!)。您需要更新資料庫中的圖像 URL,將 http://site.example.com/files/ 替換為 http://site.example.com/wp-content/uploads/sites/SITENUM/
清除每個網站的設定中的「上傳路徑」、「上傳 URL 路徑」和「檔案上傳 URL」。您可以通過前往網路管理員 > 網站,然後對每個個別網站點擊「編輯」鏈接,然後前往「設定」選項卡查找這些設定。
外掛標籤
開發者團隊
原文外掛簡介
By default, WordPress Multisite uses certain rewrite rules for file uploads. This leads to a URL that doesn’t reflect the exact location of your files on the server. This plugin disables that functionality.
Note: This plugin is extremely simple in purpose. It requires additional setup before it can be used with most Multisite Networks.
If your Multisite was initially created using WordPress 3.5 or later, then you do not need this plugin
Before Use
This plugin is very specific in purpose. In order to use it, you will need to follow some steps first:
Move your images from /wp-content/blogs.dir/SITENUM/files/ to /wp-content/uploads/sites/SITENUM/. SITENUM corresponds to the ID of each of your sub-sites.
Modify the database for each site. I recommend using this awesome script (just don’t forget to delete it when you’re done!). You will need to update the image URLs in the database to replace http://site.example.com/files/ with http://site.example.com/wp-content/uploads/sites/SITENUM/
Clear out the settings for each site for “Upload Path”, “Upload URL Path”, and “File Upload URL”. You can find these settings by going to Network Admin > Sites, then for each individual site, click the “Edit” link, then go to the Settings tab.
