WordPress.org

Ready to get started?Download WordPress

Forums

Multisite media only work for main site (22 posts)

  1. CybreTron
    Member
    Posted 2 years ago #

    With multisite 3.3.1 installed, things work fine for main site. However, when upload pictures to network sites, they are not shown. But when I clicked [Edit Image], the image shown again except the thumbnail still cannot be shown.

    I have tried different permalink settings in the setup but they all don't work. Wondering it is my installation problems or setup problems. Is there a way to solve it as now no matter what I upload to media, they cannot be show in the web page.

    Please help.

  2. What's your .htaccess set to?

    And is it subfolder or subdomain?

  3. CybreTron
    Member
    Posted 2 years ago #

    This is the .htaccess file, and I installed as subfolder:

    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]

    Thanks in advance.

  4. CybreTron
    Member
    Posted 2 years ago #

    As I checked the cropped-abc.jpg file, it is located at
    /srv/www/htdocs/wp-content/blogs.dir/2/files/2012/02

    and in the web page, the same files points to
    http://abe.example.com/files/2012/02/cropped-abc.jpg

    and currently the permalink is set to Day and name
    /%year%/%monthnum%/%day%/%postname%/

    don't know if permalink make any differences, but I have tried them all without success.

  5. CybreTron
    Member
    Posted 2 years ago #

    sorry, should be subdomain, NOT subfolder

  6. CybreTron
    Member
    Posted 2 years ago #

    Interesting yet, when I reinstall WP and set to subfolder mode, I can't even go to the new site's dashboard (Object not found] right after I added the site. I tried it twice and the problem was repeated.
    wp-content.php added:
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    .htaccess:
    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]

    Now I reinstall back to subdomain mode, everything stays fine except I can't use the media, not even view it from the list.

  7. CybreTron
    Member
    Posted 2 years ago #

    when I looked into the database record. The JPG with the meta value:
    2012/02/Hong_Kong_China_02.jpg

    shown as:
    http://abc.example.com/files/2012/02/Hong_Kong_China_02.jpg
    in the dashboard of a secondary site and could not be displayed

    whereas in the main site it is:
    http://www.example.com/wp-content/upload/2012/02/Hong_Kong_China_02.jpg
    can be displayed in dash board.

    Please note that MU Domain Mapping plugin has not yet installed.

  8. CybreTron
    Member
    Posted 2 years ago #

    With permalink sets to default, that is, click on a post and URL like
    http://abc.example.com/?p=5
    works well.

    But when I change back to 'Day and Name' type, and I click the post and the URL becomes:
    http://abc.example.com/2012/02/20/test/
    with an [Object not found!] error.

    But the plugin I want to use required that I can use any types of permalink EXCEPT the default type.

    Please note that MU Domain Mapping plugin has not yet installed.

    Please help!

  9. You're using the wrong htaccess for subFOLDER

    http://codex.wordpress.org/Create_A_Network#.htaccess_and_Mod_Rewrite

  10. CybreTron
    Member
    Posted 2 years ago #

    I am now using the one for the subdomain as I had reinstalled it as such.

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

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?siteN/files/(.+) wp-content/blogs.dir/N/files/$2 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    I added the line that is supposed to ractify the problem of images not show. I had logout and login again. But new image still doesn't work.

  11. *sigh* Okay, first posting so many times in a row tripped our spam filter. Please try to slow down, and post a longer post. Or edit your post. You have an hour from posting to edit.

    Second, that's why I missed you were on subdomain. Last time I looked you had half the number of posts.

    But when I change back to 'Day and Name' type, and I click the post and the URL becomes:
    http://abc.example.com/2012/02/20/test/
    with an [Object not found!] error.

    Are you saying that if you use pretty permalinks the site doesn't work? Cause that's a problem. THAT means your .htaccess isn't being read totally by the server. Check that AllowOverride is set to ALL

  12. CybreTron
    Member
    Posted 2 years ago #

    Thanks so much for your patients.

    Now I
    1. change the AllowOverride to All for the directory "/srv/www/htdocs"
    2. reset .htaccess file to

    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]

    3. restart apache2

    Now I get the message "Access forbidden!" though I can still access phpmyadmin.

    Don't know what did I do wrong.

  13. What's the full 'AllowOverride' section look like?

    Also if you could use the CODE tags (see the buttons above the window where you type?) that would be great.

  14. CybreTron
    Member
    Posted 2 years ago #

    The section is as follow:

    <Directory "/srv/www/htdocs">
    	Options None
    	AllowOverride None
    	Order allow,deny
    	Allow from all
    </Directory>

    That is the default setting for Apache2 during installation.

    Thanks

  15. Did you read the Creat A Network page, where we tell you that you have to set AllowOverride to ALL?

  16. CybreTron
    Member
    Posted 2 years ago #

    I really did missed that page. I just read part of it where you showed me last time... stupid me...

    Now that the folder public_html is appearing in both
    /home/virtualuser/public_html and
    /home/samuel/public_html

    and I selected /home/virtualuser/public_html to install WP (can I use either one of the folder?)
    should I put the whole WP in folder /home/virtualuser/public_html (that is my choice) or folder /home/virtualuser/public_html/wordpress?

    I had tried both but I cannot activate the setup page in WP. I got stuck in this step where I cannot go further.

    I know I am acting stupid but all these are new to me :P

    Many thanks in advance.

  17. Yes, WP should be installed in the public_html location for best results. You can't have BOTH, though, without weird stuff.

  18. CybreTron
    Member
    Posted 2 years ago #

    Oh, I see...but after I copy WP to /home/virtualuser/public_html, how can I run the WP setup? do I have to change or add a virtual server? This is where I got stuck.

    I tried localhost and 127.0.0.1 but they both go to /srv/www/htdocs/index.php and not the /home/virtualuser/public_html/index.php

    BTW, what is meant by:
    "WordPress address (URL)" is different from "Site address (URL)"? If I use http://www.abc.com, how can I make both address to be the same?

    Many Thanks!

  19. "WordPress address (URL)" is different from "Site address (URL)"? If I use http://www.abc.com, how can I make both address to be the same?

    You mean the files are in abc.com/wordpress and the URL is just abc.com?

    *facepalm* Well. That will NEVER work. In fact, you shouldn't have been able to get WP installed at all with Multisite in that case (I thought it threw an error when you did that).

    Uh. Okay. The only thing I can think of is this.

    1) MOVE the files from the folder into abc.com

    2) SEARCH the database for that folder name and remove it.

    Honestly, though, I'd probably be inclined to make a NEW install in thr public_html folder, and start over. You can always import any posts from the other site.

  20. CybreTron
    Member
    Posted 2 years ago #

    Actually that's what I want to do i a fresh installation. I just want to make sure where I should place files like index.php (and other files). Is it /home/virtualuser/public_html in my case?

    When I download WP3.1 its in zip format. All I can do is to copy 'install' all those files and folders to a directory. The point is after I copy all those files to /home/virtualuser/public_html. How can I make it run the /home/virtualuser/public_html/index.php instead of running /srv/www/htdocs/index.php ?

    do I have to create a virtual host?

    Thanks

  21. How can I make it run the /home/virtualuser/public_html/index.php instead of running /srv/www/htdocs/index.php

    Okay, now you're not asking a MULTISITE question, or even a WordPress one. You're asking a basic 'How do I set up an account on a webhost.' (for the record, my site runs out of /home/username/public_html - it's supposed to).

    Do you have any experience setting up webhosts? Are you on a managed server where a webhost can help you?

  22. CybreTron
    Member
    Posted 2 years ago #

    You are right... I should check it out somewhere else :)

    I don't have experience in setting up webhost. Maybe this is the major problem of why I have so much troubles in setting up WP network. Anyway, thanks so much... and you have pointed me the right direction to solve the problem.

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic