Forums

[closed] New 3.0 install, images not working in subsites (64 posts)

  1. greene.md
    Member
    Posted 2 years ago #

    I'm having similar image issues that many have reported. I can upload and insert images fine in my default site. When in a sub-site however, you can upload the image successfully, but can not see it in the uploader/gallery/edit page interface.

    My site currently isn't accessible outside of our network so I can't give out links for you to see but what I've found out is that the default url for the image:

    http://reconstruct.rappahannock.edu/rappenings/files/2010/06/01356_crepuscule_1440x900.jpg

    does not work while

    http://reconstruct.rappahannock.edu/wp-content/blogs.dir/25/files/2010/06/01356_crepuscule_1440x900.jpg

    does. My .htaccess appears to be correct, I've tried disabling plugins, but nothing has worked thus far. Any help would be amazing. Thank you.

  2. greene.md
    Member
    Posted 2 years ago #

    I've installed another 3.0 network in a subfolder /dir on the same server. Images work in the sub-sites of that install. So it must be root folder related. Both the root (/www) and /dir folders have the exact same .htaccess file defined by 3.0 network install.

    I have AllowOverride All turned on, I'm really grasping at straws here. I think I've tried every solution I've seen on the Multisite forums thus far and it's still not working. Any ideas anyone?

  3. greene.md
    Member
    Posted 2 years ago #

    Now the sub-site I've been trying this in /rappenings won't appear at all. But the admin interface still works, what it going on here? Now I'm completely confused.

  4. greene.md
    Member
    Posted 2 years ago #

    Fixed the issue of the site not showing up. Theme error, images still not working though.

  5. greene.md
    Member
    Posted 2 years ago #

    I just tried uploading a PDF and inserting that into a post. Worked fine, server redirected the link and the browser downloaded the file. So why won't images work?

  6. riddhishshah
    Member
    Posted 2 years ago #

    have you try this..may be will help you.

    I modified my htaccess file and change the path as below..
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
    because previously it was with RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    and if you are using WPMU 3.0 blog.php is no longer in use, so far everything is working fine for me. did you check your htaccess as well as .htaccess

  7. greene.md
    Member
    Posted 2 years ago #

    riddhishshah, thanks for the tip. Unfortunately I still can't get uploaded images in sub-sites to show up. What do you mean by

    did you check your htaccess as well as .htaccess

    I've been checking my .htaccess file and it appears correct, I don't have a htaccess file if that's what you mean.

  8. riddhishshah
    Member
    Posted 2 years ago #

    your RewriteRule shows blog.php or mu-files.php in your htaccess file. Because blog.php is no longer in use if you are using 3.0 MU.

  9. greene.md
    Member
    Posted 2 years ago #

    Here is my .htaccess file

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    #RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    RewriteRule ^(.*/)?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]

    The first uploads rewrite rules is the original WP told me to use and the second is the one riddhishshah recommended. Since this was a fresh install I don't believe I've ever used blogs.php in any of my .htaccess or http.conf rules.

  10. riddhishshah
    Member
    Posted 2 years ago #

    are you working on localhost? just checking you might done this but check Upload file types

  11. greene.md
    Member
    Posted 2 years ago #

    It's a Windows server 2008 machine that I remote into so no. I had originally set everything to localhost but when we tried to switch to a normal domain name I had a bunch of crazy errors so I scrapped everything and did a fresh install using the reconstruct.rappahannock.edu domain name. Everything has worked fine except this images in sub-sites issue.

  12. greene.md
    Member
    Posted 2 years ago #

    jpg and jpeg are listed under upload file types

  13. greene.md
    Member
    Posted 2 years ago #

    I've tried each of these Rewrite rules and none of them have worked.

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

    I've also tried switching the file=$2 to file=$1 on each of the rules as well. My background is in design so a lot of this is new and some still doesn't make sense. Any other tricks you can think of to play around with?

  14. enjaytee
    Member
    Posted 2 years ago #

    The .htaccess file won't work with server 2008.
    You need to have the rewite module installed on the server Here

    You also need to configure the web.config file which is IIS's version of .htaccess sort of. Mine looks like this. The 2nd rule helps with pretty permalinks.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <defaultDocument>
                <files>
                    <clear />
                    <add value="index.php" />
                </files>
            </defaultDocument>
            <rewrite>
    		    <rules>
                    <rule name="Uploaded Files" stopProcessing="true">
                        <match url="^files/(.+)" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" />
                    </rule>
    		        <rule name="Main Rule" stopProcessing="true">
    		            <match url=".*" />
    		            <conditions logicalGrouping="MatchAll">
    		                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    		                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    		            </conditions>
    		            <action type="Rewrite" url="index.php" />
    		        </rule>
    		    </rules>
    		</rewrite>
        </system.webServer>
    </configuration>

    Hope this helps

  15. greene.md
    Member
    Posted 2 years ago #

    enjaytee, I am using Apache not IIS on Windows Server. Sorry, I should have mentioned that in my previous post. Thank you though.

  16. greene.md
    Member
    Posted 2 years ago #

    I'm trying to experiment with a specific Rewrite Rule just to see if I can get an image url to rewrite at all. Does anyone know how to write a rule to take
    http://reconstruct.rappahannock.edu/wp-content/blogs.dir/25/files/2010/06/Photo-3-copy.jpg and rewrite it to http://reconstruct.rappahannock.edu/rappenings/files/2010/06/Photo-3-copy.jpg

    I tried using ReWriteRule ^files/2010/06/Photo-3-copy.jpg wp-content/blogs.dir/25/files/2010/06/Photo-3-copy.jpg but that didn't work.

  17. I think you want this:

    RewriteRule ^rappenings/files/2010/06/Photo-3-copy.jpg http://reconstruct.rappahannock.edu/wp-content/blogs.dir/25/files/2010/06/Photo-3-copy.jpg

  18. greene.md
    Member
    Posted 2 years ago #

    Thanks Ipstenu, I tested

    RewriteRule ^rappenings/files/2010/06/Photo-3-copy.jpg http://reconstruct.rappahannock.edu/wp-content/blogs.dir/25/files/2010/06/Photo-3-copy.jpg and

    RewriteRule ^files/2010/06/Photo-3-copy.jpg http://reconstruct.rappahannock.edu/wp-content/blogs.dir/25/files/2010/06/Photo-3-copy.jpg

    Both gave me a 404, which is different than what the wordpress standard rewrite rule does (no error, the image just doesn't show up). I'm beginning to think that Apache is not capable of rewriting these images at all. I am not a server admin but had to setup Apache, MySql, Php myself. Is there something I could have missed outside of this .htaccess setup?

  19. Apache can do it, it's Apache on Windows that is the issue. ;)

    Are you absolutely sure you installed the mod_rewrite module? If so, you may need to specify in the vhost file that it needs to read the htaccess file directly.

  20. greene.md
    Member
    Posted 2 years ago #

    Well... I assumed mod_rewrite was working because 'pretty permalinks' were working. At this point I'm willing to try anything aside from scraping my database again. What would I need in my vhost file to make it read the .htaccess? My vhost looks like this

    ServerName reconstruct.rappahannock.edu
    NameVirtualHost reconstruct.rappahannock.edu
    <VirtualHost *>
        DocumentRoot C:/Server/www
        ServerName reconstruct.rappahannock.edu
    </VirtualHost>

    The C:/Server/www folder is where my .htaccess lives

  21. AllowOverride FileInfo Options

  22. greene.md
    Member
    Posted 2 years ago #

    Andrea when I try to add that line of code to my vhost, Apache can not restart. Apache error log says Allow Override not allowed here, that could be due to something I changed in the http.conf file but I'm not sure what it might be. VHost looks like this.

    ServerName reconstruct.rappahannock.edu
    NameVirtualHost reconstruct.rappahannock.edu
    <VirtualHost *>
        DocumentRoot C:/Server/www
        ServerName reconstruct.rappahannock.edu
        AllowOverride FileInfo Options
    </VirtualHost>
  23. greene.md
    Member
    Posted 2 years ago #

    I have uploaded a copy of my httpd.conf file here, if that helps anyone. I can upload other files there as well if you want to look at them. My network admin is trying to open up the firewall to allow web traffic in but that might take a few hours. Again, thank you everyone who is thinking about a solution to my problem.

    http://michaelgreene2.com/httpd.conf

  24. greene.md
    Member
    Posted 2 years ago #

    Thank you for the link Andrea, I learned a lot from that. My problem still stands however. I'm almost convinced it's not an .htaccess problem at all, i just don't know where else to look. Hopefully later today or early tomorrow I'll have an outside IP I can direct you to and maybe that will spark someone's imagination.

  25. ebald
    Member
    Posted 2 years ago #

    Greene, I have the same issue... Did you resolve that?

    Thank you in advance.

  26. greene.md
    Member
    Posted 2 years ago #

    ebald, I have not fixed the issue yet. We're launching at the end of this month and this is a real problem. I'm hoping someone can think of something soon...

  27. 256studio
    Member
    Posted 2 years ago #

    I had sorta the same issue with a standard wp install on localhost using Apache. what I did was right clicked on the folder and run as admin on that folder now i can see all my images and lot more. it is something with the permission in win 7 to server 2008...

    try that....

  28. gazouteast
    Member
    Posted 2 years ago #

    Michael

    I might be off on a wild goose chase here ... but ... can you confirm if you are using subdomain or subdirectory install?

    That is - are you aiming for
    blogname.reconstruct.rappahannock.edu/
    or
    reconstruct.rappahannock.edu/blogname
    ?

    Next look at this sample URL you gave -
    reconstruct.rappahannock.edu/rappenings/files/2010/06/Photo-3-copy.jpg

    Is reconstruct the server machine's hostname or is it a subdomain of the dot edu?

    Is rappenings a subfolder off the dot edu, or is the blog root?

    If rappenings is the blog root, you cannot do a subdomain install, and " vhosts " cannot be set up - it is a reserved function in wp-config.php (or was under WPMU 2.9.2 and earlier - not so sure about 3.0)

    If "reconstruct" is a blog name, then "rappenings" has to be a posts category name, not a sub-blog (because reconstruct is already a subdomain sub-blog, and you cannot have sub-domain and sub-directory sub-blogs in the same install (unless Andrea and Ron have come up with something new and extremely clever)).

    Have to ask this because it confused the heck out of me all the way down the thread.

    Gaz

  29. greene.md
    Member
    Posted 2 years ago #

    Gaz, no problem answering those questions.

    I'm doing a subdirectory install.

    WordPress is in the root folder C:/Server/www and rappenings is simply one of the sub-blogs.

    The hostname is reconstruct.rappahannock.edu (although technically isn't is a subdomain as well? - side note) which will be changed to http://www.rappahannock.edu in August.

    Rappenings has no physical folder, just the blogs.dir/25 folder wordpress creates.

Topic Closed

This topic has been closed to new replies.

About this Topic