Tag Archives: WordPress MU/MS

WordPress MS (3.0 & above) Media Upload Problem

WordPress Multisite media upload problem is problem not every one met. This wpms media problem mostly appears for people in dedicated IP address hosting and in shared hosting. If you don’t have this problem then skip this post, you don’t need this.

[sniplet postads]

I already wrote the solution for media upload problem for wordpress 2.9 multi user (WP MU). After the release of WordPress 3.0, WPMU is vanished as WP 3.0 has every feature that where in wpmu. That is WordPress MS (multi site).

For WordPress MS you just have to enter the below code in your .htaccess file in your root of the hosting space.

Before doing this step, Read WordPress Media Upload Problem Solved to know why we are doing this step.

[sniplet postads]

RewriteEngine On
RewriteBase /

#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

[sniplet postads]

Delete all the content in .htaccess before pasting this. When comparing to wpmu this code for wpms just have only one small modification that the new wordpress has changed the file blogs.php in mu to ms-files.php. so changing this will effect this media problem.

WordPress MU Media Upload Problem Solved

Recently I came across this wordpress MU media upload problem while working with one of my client’s WPMU site. The main difference between WordPress single and WordPress MU is Redirection. WordPress never involves in redirection while wpmu is fully dependent to redirections.

The WordPressMU media problem is ‘when you upload media files to blog’s files directory it won’t displays in the post even after the successful upload. This happens because the media file uploaded to individual blog directory like

“wp-content/blogs.dir/o7/files/2010/05/img.jpeg” where the syntax is “wp-content/blogs.dir/blog id in #/files/year/month/mediafilename.ext”

[sniplet postads]

When you update this image to your post, you will find the link as follows

“http://blog07.yoursite.com/files/2010/05/img.jpeg” . When you try to view the image in browser, WPMU redirects this link to blog’s particular files directory according to the blog id. So when you have problem in redirection the it affects the media upload feature of WPMU sub blogs.

Most of the folks using WPMU is in shared hosting have this problem. When you try to install WPMU first it will create a .htaccess.dist file, you can replace it with .htaccess file to solve this problem. If you don’t have that or problem in updating httpd.conf file given in WordPress documentation installation file you can update the following code in your .htaccess file.

Delete all content in your .htaccess file and replace it with the following code,

RewriteEngine On
RewriteBase /

#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

[sniplet postads]

If you still have problem in media-upload feature, check with your media-upload options in your admin tabs in wp-admin controls. set the minimum upload limit to some what high then previous.

For queries about this comment here….

WordPress MU Sub Domain, Wild Card DNS

WordPress is famous for its 5 minutes few click installation. But most of the bloggers experience that WPMU installation is not easy. Many of the wordpress users face problem while installing wordpress MU or when trying to make it work for sub domain blogs.

WordPress MU has all the steps as same as installing wordpress, all you have to do extra is some tweaks in server settings. Many stuck in this step. The people install wpmu in dedicated server don’t face problem if they follow the steps in wordpress mu blog for installation.

[sniplet postads]

This for people who would like to install WPMU in shared or vps servers. The problem here is some of the users don’t have permission to edit httpd.conf file in their server and some don’t have rights to edit DNS settings. If this is your problem in installing WPMU in your hosting account then just follow the simple tweak given below.

All you have to do is just add a sub domain as follows in your hosting account with the help of cPanel, Plesk or other server tools that you have. Go to ‘add sub domain’ menu not ‘add on domains’ then add ‘*’ sub domain redirecting it to the root.

click “sub domain” -> “add” -> enter ” * ” without quotes in sub domain name -> enter “public_html/” in directory text box without quote, then add it.

after adding you should get a subdomain like below in the sub domain list

*.yourdomain.com not redirected    pointed to  public_html/

optional :  so if you want to install wpmu in other shared add on domain then simple enter that domain name like below,

*.addondomain1.com pointing to public_html/addondomain1.com/ where wpmu is installed.

Your tweak is finished and now you are ready to go with you wpmu. Read fully to know more…

If you still have problem I am glad to help you if you post a comment here.

[sniplet postads]

Don’t worry about other settings like <virtualhost> settings in httpd.conf and adding data in DNS settings. Everything is optional. The above tweak works fine with all the hosting services without much work.

Note : How it works?

wordpress mu is handling multiple blogs with same wordpress files which is installed in the root directory. when we enter the blog name like “blog1.alvistor.com” it searches for files in blog1.alvistor.com, all that we have to do is to redirect the blog1.alvistor.com to “alvistor.com” so to do this for every sub domain blog like blog2.alvistor.com, blog3, blog4, etc we to add a redirect for every blog.

Just by adding a * as a subdomain ( * is a wild card here) every alphabets and numbers are assigned for * and all the blogs are directed to root directory. Now simply wpmu handles the others.

However this will not work for media upload in wordpress post editings, to avoid media upload issue in wpmu please check out the posts in related posts.