WordPress.org

Ready to get started?Download WordPress

Forums

Image path are differ from image upload path (4 posts)

  1. usman.mang
    Member
    Posted 2 years ago #

    Hi:
    I am facing a problem that in all my mini sites images are upload in location http://domain-name/wp-content/blogs.dir/2/files and during uploading it makes the path http://domain-name/files that is different,that,s why images are not displayed on the site..
    here,s my htacess file code:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /projects2012/notforprofitfunding/
    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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress

    please help me to sort out this situation...:-(

  2. dgilmour
    Member
    Posted 2 years ago #

    Have a look at your wp-config.php file. Variables in there can change where WordPress thinks your install lives: http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29

  3. usman.mang
    Member
    Posted 2 years ago #

    thanks for the reply but i could not understand that how the variable can change? Here,s my config.php code which i have used in all my mini sites..

    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/projects2012/notforprofitfunding/';
    define( 'DOMAIN_CURRENT_SITE', 'websoftnet.com' );
    define( 'PATH_CURRENT_SITE', '/projects2012/notforprofitfunding/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Is there something wrong with this code?

  4. I am facing a problem that in all my mini sites images are upload in location http://domain-name/wp-content/blogs.dir/2/files and during uploading it makes the path http://domain-name/files that is different

    That's not an error. It's supposed to be like that.

    See this?
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    That's the magic that translates domain.com/files/ to domain.com/blogs.dir/2/files/

    It works. When it DOESN'T work, check that your httpd.conf has AllowOverride set to all.

    If it does, go find the URL of an image:
    domain.com/blogs.dir/2/files/2012/04/image.jpg

    Then try looking at domain.com/wp-includes/ms-files.php/2012/04/image.jpg

    Does that second URL work?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.