Ad Code

Ticker

6/recent/ticker-posts

Recent Posts

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


Post a Comment

0 Comments

Comments

Ad Code