WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Not found error for images in subdomain (25 posts)

  1. ethilanka
    Member
    Posted 3 years ago #

    Im getting "Not Found" error when i upload and view media (images) to my sub domain blog. I was able to upload media (images)and view them successfully in the Site Admin login.

    I have noticed the follow as well.

    Site Admin Image upload path : http://domain.com/wp-content/uploads/2011/05/image.jpg

    Sub domain blog image upload path : http://name.domain.com/files/2011/05/image.jpg

    Highly appreciate some one can help me to sort this out...!

    Cheers..!

  2. In and of itself, the folder locations are not incorrect.

    WordPress smartly redirects the /files/ location to blogs.dir/#/files (where # is your site #).

    Normally the images not found is due to a problem in the .htaccess file either in itself or not being read. So can you share your .htaccess file? :)

  3. ethilanka
    Member
    Posted 3 years ago #

    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]

    This is my .htaccess file.. Thanks for the time.

  4. Okay, that looks correct.

    What happens when you go to http://name.domain.com/wp-includes/ms-files.php?file=2011/05/image.jpg

  5. ethilanka
    Member
    Posted 3 years ago #

    then i can see the image...!

    What should i do now..?

  6. It means WP is fine, but your server isn't reading your .htaccess correctly.

    If you have access to your httpd.conf file on the server, check your Apache Virtual Hosts settings. You need to make sure AllowOverrides is set correctly.

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

  7. wolfsteritory
    Member
    Posted 3 years ago #

    i have kinda the same problem

    SOME pictures are gone
    you can see here
    http://ambulantadiacena.ro/

    do you have any clues ?

  8. wolfsteritory
    Member
    Posted 3 years ago #

    Domain Mapping

    New primary domain.
    Active domains on this blog
    Primary Domain Delete
    http://ambulantadiacena.ro Del
    http://diacenamedical.ro/11

    works fine on http://diacenamedical.ro/11

    doesn't work if i set it to http://ambulantadiacena.ro

  9. wolfsteritory
    Member
    Posted 3 years ago #

    TimThumb came with the best theme i could fine to be able to modify it in what i needed

    u know of any upgrades ? or something

  10. wolfsteritory - You're now derailing someone else's topic. That's rude.

    If you bothered to google for 'timthumb' and 'wordpress multisite' you'd see a lot of people have suggestions and solutions. NONE of this has to do with domain mapping or ethilanka's issues. ALL of it has to do with TimThumb.

    Make your own topic for help.

  11. ethilanka
    Member
    Posted 3 years ago #

    You need to make sure AllowOverrides is set correctly.

    I was in a confusion where to put this code in the httpd.conf since i dont have the mentioned "/var/www/vhosts/wordpress" folder exists in my server..? Do i need to create a folder there or is this a sample path...?

    can someone explain me please..!

    Cheers...!

  12. ethilanka
    Member
    Posted 3 years ago #

    This is my httpd.conf virtual host area... do i need to add some more here..?

    <VirtualHost *:80>
    ServerAlias *.lkblogspot.com
    #    ServerAdmin webmaster@dummy-host.example.com
    #    DocumentRoot /www/docs/dummy-host.example.com
    #    ServerName dummy-host.example.com
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>

    I have added the below in httpd.conf where the default document path

    DocumentRoot "/var/www/html"
    
    #
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    #
    # First, we configure the "default" to be a very restrictive set of
    # features.
    #
    <Directory />
        Options FollowSymLinks
        AllowOverride Fileinfo Options
    </Directory>

    Could you please confirm is this correct or do i need to create the path on virtual host and what will be it..??

  13. "/var/www/vhosts/wordpress" is an example. You may not have it.

    In my server, I have the file at /etc/httpd/conf/httpd.conf and in there I have this:

    <Directory "/">
        Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes -MultiViews SymLinksIfOwnerMatch
        AllowOverride All
    </Directory>

    If you don't nkow how to do this, it's okay, just ask your host for help :)

  14. ethilanka
    Member
    Posted 3 years ago #

    done the same but no luck yet...

    any suggestions please...??

    Shall i post my whole httpd.conf file here..? so then you can tell me the exact error right..?

  15. I don't claim to be an expert on httpd.conf, which is why I suggested you ask your host. Every server's a little different.

  16. ethilanka
    Member
    Posted 3 years ago #

    no.. this is a vps...! I have installed it and configured.... i just want to know what exactly we have to do in the httpd.conf

    In every document / forum using a sample path or a code... so that im unable to figure out the sample or the original code out of it... if you have the exact step by step guide that has the ability to make sub domain create a network for wordpress it will be a help..

    Cheers..!

  17. There is the problem. I do not have a step-by-step guide to tell you how to set up your VPS to handle .htaccess correctly because there is no one way for a server to be setup and this no one way for it to be configured.

    Are you paying someone to host your VPS server? Do they offer support? Take them up on it.

    I have a VPS too. The whole reason I pay them as much as I do is that when I don't know how to do something, they can do it for me. :)

  18. ethilanka
    Member
    Posted 3 years ago #

    My VPS provider not supporting for me since it is a unmanaged service.

    I have to find a solution by my self... Could you please someone try to help me to sort out this....?? Only problem im facing is.. my subdomain images are not showing on the given path and it is missing some parts of it..

  19. My VPS provider not supporting for me since it is a unmanaged service.

    Yeah... see you need more help then. What you need to do is experiment with how to set up allowoverride on your virtual host. You could TRY this:

    <VirtualHost *:80>
    ServerAlias *.lkblogspot.com
    #    ServerAdmin webmaster@dummy-host.example.com
    #    DocumentRoot /www/docs/dummy-host.example.com
    #    ServerName dummy-host.example.com
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    
    <Directory />
        Options FollowSymLinks
        AllowOverride Fileinfo Options
    </Directory>
    </VirtualHost>

    But you're going to have to study up on Apache.

    And this is why I pay extra for managed VPS. I know I don't know everything.

  20. ethilanka
    Member
    Posted 3 years ago #

    no luck yet.... I have tried as you mention....

    As per to my observation...! when we request the image from sub-domain blog it doesn't give the exact path / URL it just shows the broken path... i hope this will be a fault with the wordpress settings or config files... as you can see many of the ppl are frequently getting the issue....! cant we escalate this to a developer who involved with this project...??

    So that everyone can get the answer in a single thread and fix this issue and be able to publish it so that ppl will not be confused and they won't open multiple threads for single issue...

  21. You're missunderatanding how it works.

    It's SUPPOSED to point to /files/YYYY/MM/DD/Imagename.jpg -- We WANT that to happen. It's NOT broken.

    Remember when I said this WAY in my first post?

    WordPress smartly redirects the /files/ location to blogs.dir/#/files (where # is your site #).

    Trust me. It's correct. It's working.

    you point to http://name.domain.com/files/2011/05/image.jpg

    WP translates that to http://name.domain.com/wp-includes/ms-files.php?file=2011/05/image.jpg (Remember? You tested that AND IT WORKED!!!)

    And THAT gets finally parsed as http://domain.com/wp-content/uploads/2011/05/image.jpg

    That whole process depends on a couple things, but most important is your .htaccess being able to do that middle step. YOURS fails. It is failing to parse this:

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    That's why I had you test the URL with that format in there. And since THAT was successful, I know it's not WordPress breaking (because it can parse the image from that location), but your .htaccess, which means the .htaccess isn't handling redirects as well as it could. Which means it's the configuration of the server, which is handled in the httpd.conf file.

    And at this point, I've given you the advice and directions I have. So you can either research it, google 'httpd.conf wordpress multisite', hire someone, or wait and see if someone better with httpd.conf rolls in.

    (And posting in other peoples topics, when (1) you have your own and (2) You aren't having the EXACT same issue pisses people off and makes it MUCH harder to help anyone. Don't do it.)

  22. dunxd
    Member
    Posted 3 years ago #

    Login to your VPS, then navigate to the folder that contains your wordpress files. Type pwd to display the current working directory.

    Then where you see /var/www/vhosts/wordpress in the documentation replace with what you saw above.

  23. . i hope this will be a fault with the wordpress settings or config files... as you can see many of the ppl are frequently getting the issue....! cant we escalate this to a developer who involved with this project...??

    It is 100% a server side issue. A developer will not be able to tell you anything different than ipstenu already has. this isn't even multisite specific, as any program using htaccess files, and those getting ignored by the server, will need the same "fix".

    I am extremely familiar with your issues, as I've had it myself, and have had to learn it myself on my own VPS and then dedicated box.

    Start reading Apache docs.

  24. ethilanka
    Member
    Posted 3 years ago #

    Thanks everybody.... after a long period of struggling with wordpress and with apache.... It worked for me....!

    Note my work out on this...!

    in httpd.conf i have edited the virtualhost as follows.

    <VirtualHost *:80>
    ServerAlias *.domainname.com
    
    <Directory /var/www/html>
        Options FollowSymLinks
        AllowOverride Fileinfo Options
    </Directory>
    </VirtualHost>

    again thanks for Ipstenu - who helps me to find the way
    dunxd - who gave me a clue
    Andrea_r - who enlighten my thread

    Cheers..!

Topic Closed

This topic has been closed to new replies.

About this Topic