Skip to main content

Solved: Multisite upload images

I have issue uploading images using a wordpress multisite environment. I've posted this to the Wordpress community and got a superb assistance from lpstenu.

Here's how I started noticing I can't upload any images to other websites in multisite environment:
+++
"Uploading images in wordpress multisite questions.
If I upload an image at king.net it goes to http://www.king.net/wp-content/uploads/2012/05/20120521-064035.jpg
while if I upload the same image through friended.com it goes tohttp://friended.com/files/2012/05/20120521-063835.jpg but the image won’t work.
I dried using the un-mapped version e.g. friends.king.net (for friended.com) got the same results.
How to fixt it?
Thanks in advance."
+++
The forum member "lpstenu" asked mbe to verify my .htaccess and httpd.conf file has "allowoverride" set to all. I verified, and also contacted by web hosting company to re-verify this for me. Another set of eyes, is a good thing.
And I posted my .htaccess file, as depicted below so I can get more input.
+++
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
</IfModule>
+++
Then "lpstenu" posted this link (http://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite) to check my .htaccess configuration. 
He directed me to see a samples of .htaccess file for subfolder and subdomain. That's where I found out that something is wrong with my .htaccess file.
SubFolder Example
# 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
SubDomain Example
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress
To solve my upload issue, I copied the subdomain example, and it works perfectly. Come see the website www.friended.com or www.king.net for live demo
Source: Whaddya.com


Comments

Popular posts from this blog

Office365 - This resource doesn't accept meetings longer than 1440 minutes

When you create a meeting schedule for number of days , you will see an error  "This resource doesn't accept meetings longer than 1440 minutes". By default the mailbox or room was set for a maximum limit of 1440 minutes. Here's how you can disable this limit. Login to the Office 365 Administration Console In Microsoft Office 365 Exchange, click on Manage . In Manage My Orgnization , click the drop down arrow, and click on Select on Another User . This will prompt you to select the mailbox or room to manage. Select a Mailbox or Room , click OK . In Option, click on Settings. In Scheduling Options, un-check the "Limit meeting duration", then click on Save. That's all. You can now schedule a meeting or reserve a room for number of days. Hope this help you. If this helped you, please take the time to share this post by sharing using Google+, Facebook, Twitter, or LinkedIn

Out of Office Reply for Termed Employee

This is a sample Out of Office message that I used for termed employees, unless HR staff specified a different message. === Example for KING.NET Employee === John Doe (employee or consultant)  is no longer with KING.NET effective  June 1, 2013  (termination date). For matters relating to " Project Name here " please direct your concerns to  John Smith at  johnsmith@king.net (Manager or Supervisor) . For all other matters, please direct your email to Mary Smith HR at marysmith@king.net. Please call our main office 703-345-6789 if you have other concerns. Thank you. === End of message === I posted this article year 2008 from my old blog. http://whaddya.blogspot.com/2008/11/example-of-out-of-office-reply-for.html If this helped you, please take the time to share this post by sharing using Google+, Facebook, Twitter, or LinkedIn

VMware ESXi to add storage

Have you tried to add storage in your VMware environment after the initial setup and configuration? In my case, I needed to add storage for more space to copy virtual machine files. This is also the same approach to access a USB drive to import a vmx and vmdk files (virtual machine and data storage). For this article, I will provide a step by step procedure on how to add your USB drive from one of your Windows Server (or workstation). Let's use a Windows Server 2003 for reading your USB drive. By default, the NFS service is not enable. So, you have to add this service first. Go to Start , Control Panel , Add or Remove Programs , Add/Remove Windows Components , Other Network and Print Services , and select all for Microsoft Services for NFS . You asked, Why enable NFS Service? The VMware is based using Linux, so you need to enable NFS service to share your network drive or folder. Share a USB drive or folder. Open your Windows Explorer and browse your USB drive. In your