i'm using a non-vhost version, and a RewriteRule doesn't help.
For a non vhost installation one need to change the path
to access an uploaded image from
http://www.domain.com/path/blogname/files/year/month/filename
to
http://www.domain.com/path/wp-inst/wp-content/blogs.dir/blogid/files/year/month/filename
I edited the wp-inst/wp-includes/functions-post.php, about line 936 and changed
$url = trailingslashit($siteurl) . UPLOADS;
to
// generate url depending on vhost or not-vhost installtion
if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' )
$url = trailingslashit($siteurl) . UPLOADS;
else {
global $wpdb, $blog_id;
$domain = $wpdb->get_var("SELECT domain FROM $wpdb->blogs WHERE blog_id = 1"); // get the domain of the main blog / TODO: do this nicer
$path = $wpdb->get_var("SELECT path FROM $wpdb->blogs WHERE blog_id = 1"); // get the path of the main blog / TODO: do this nicer
$url = 'http://' . $domain . $path . 'wp-inst/wp-content/blogs.dir/' . $blog_id . '/' . UPLOADS;
}
There might be a bettter way!
Especially i'm not sure if one can rely in the fact that the blog with blog_id==1 actually IS the main blog.
Has anyone an idea on how to make this better?
Can i rely on that blog_id==1 trick?