• Hi,

    I am using 3.9.1 wordpress in multisite instalation with default htaccess for this configuration:

    RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.php$ - [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]

    Problem is this:
    /wpcontent/uploads/something.pdf – 404 not found (template page – so it is OK)
    /wp-content/uploads/something.pdf – 404 not found (apache server 404 page, not template page – NOT OK)
    /wp-content/uploads/some/thing.pdf – 500 internal server error (NOT OK)

    So wp-content in URL is problem (server 404 page) and any directory after wp-content directory is problem too (500 internal server error). I think the same it would be for wp-admin and wp-include directory (i did not try it)

    What is your experience??? The same? And how to solve it?

    Thank you
    Bary

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Check your server’s PHP error logs. But also … Did this ever work? Did it work before you activated multisite? Does this happen on all sites or just one?

    Thread Starter Bary

    (@bary)

    Did this ever work??? I do not know because it was not tested at all after install. What am I asking if somebody has multisite too if that person can test it. It is 1 minute test to try 3 urls with not existing file. I think the result would be the same. Or not ??

    And this problem is on multisite only. I have a normal singlesite wordpress instalation and using this 3 url above it returns correct 404 teplate pages. So my opinion is……default multisite htaccess is not ok (with permalink structure /%postname%/ and sub-dir config example.com/site1, example.com/site2 and so on if it is important).

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It works fine on my site. All images and files show as they’re supposed to. PDF or not, it’s all fine.

    In fact, everyone else’s works fine. I know this because if wp-admin/wp-content/wp-includes didn’t work, nothing would work. So this is just you ??

    So my opinion is……default multisite htaccess is not ok (with permalink structure /%postname%/ and sub-dir config example.com/site1, example.com/site2 and so on if it is important).

    Well. Why? Did you test with the default permalinks (i.e. ?p=123 style).

    Did you test on the site with singlesite, before making it a network?

    Does it happen on ALL sites on your network or just some?

    Thread Starter Bary

    (@bary)

    All images and files show as they’re supposed to….

    All files shows???? But my problem is not with existing files but with URL of files whitch does not exist. So it is broken link. With these files it seems to me that 404 template page is not shown and 500 error appears. So this is at your site OK?

    Default permalink not tested.
    On single site I tested, it is on there as I wrote 2 comments above.
    Yeah..it heppened on ALL sites of my network.

    Thread Starter Bary

    (@bary)

    Maybe this is important. It happens on site, where blog ID1 is used with content. So my site has url example.com and there is a content. Blog ID2 is used too, and this is example.com/en. If I make multisite with blog ID1 empty and first content website with ID2 (example.com/en) and next with ID3 (example.com/de) it is OK. I tested on another multisite wordpress instalation.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    But my problem is not with existing files but with URL of files whitch does not exist. So it is broken link.

    You’re going to have to give us REAL URLs at this point, because your examples aren’t making sense.

    Problem is this:
    /wpcontent/uploads/something.pdf – 404 not found (template page – so it is OK)
    /wp-content/uploads/something.pdf – 404 not found (apache server 404 page, not template page – NOT OK)
    /wp-content/uploads/some/thing.pdf – 500 internal server error (NOT OK)

    If I translate that to what I have on my site it’s this:

    /wpcontent/ANYTHING – This will be a 404, becuase it doesn’t exist.
    /wp-content/ANYTHING – Works, provided the files is there

    If I make multisite with blog ID1 empty and first content website with ID2 (example.com/en) and next with ID3 (example.com/de) it is OK.

    Yeah, we need to see the real sites and the real working/not working URLs because I don’t understand what your examples mean.

    Thread Starter Bary

    (@bary)

    I suppose that ANY of not existing URL should return template 404 page, so If I try any URL it should return 404 tamplate page, but this is not what happen on my site. I found a key where this is not correct using not existing URL and combine wp-content directory with another to find it out what happen and when it happen. So my question is…is this only at my site or is it a complex problem??

    So my examples are 4 comments above: Take any of your multisite where blog id1 is used for a content, make paermalink with postname and have default htaccess, then try this url and see what happen.
    I suppose that pdf file does not exist, “wpcontent” directory does not exist and directory “some” does not exist.

    /wpcontent/uploads/something.pdf – 404 not found (404 template page – so it is OK)
    /wp-content/uploads/something.pdf – 404 not found (apache server 404 page, not template page – NOT OK)
    /wp-content/uploads/some/thing.pdf – 500 internal server error

    Just copy this 3 URL with same configuration posted above and give me result, thats all I am asking.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    https://halfelf.org/wpcontent/uploads/something.pdf – 404 not found (404 template page – so it is OK)
    https://halfelf.org/wp-content/uploads/something.pdf – 404 not found (404 template page – so it is OK)
    https://halfelf.org/wp-content/uploads/some/thing.pdf – 500 internal server error (expected because of the .htaccess rules – the extra / in there makes WP think it’s a subfolder)

    Thread Starter Bary

    (@bary)

    OK thank you now it is clear that second address on my site is bug in my theme I suppose.

    Third address…500….should not it be repaired? So it means that every subfolder inside uploads folder create internal server error if you call not existing file there?? Is it possible to return 404 as well because the file does not exist and it is the same situation??? Does it mean to edit htaccess somehow?? And because it is a default htaccess from wordpress…some info into wordpress developers should be fine I guess. What is your opinion?

    EDIT: https://halfelf.org/wp-content/notexistingdirectory/file.pdf – again 500 too. It can not be in uploads folder. So?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    So it means that every subfolder inside uploads folder create internal server error if you call not existing file there??

    No. It means every fake folder does that. Want a real one?

    https://halfelf.org/wp-content/uploads/test/test.txt

    That’s a real folder ?? Works fine.

    The error in the error log (which I did suggest you look at much earlier on) for me is this:

    [Thu Dec 04 08:42:55.381648 2014] [core:crit] [pid 1901] (13)Permission denied: [client 222.253.182.145:46153] AH00529: /home/ipstenu/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/home/ipstenu/public_html/’ is executable

    So if we look that up, we see that it’s what’s expected to happen based on the complex rules that forced us to set AllowOverride ALL in the first place.

    https://wiki.apache.org/httpd/PcfgOpenfile

    Furthermore, in my case I know the error has also been reported for Users who use mod_ruid (which I do) and I need to ensure that all virtual_host2*.conf files have the mod_ruid code set: https://forum.directadmin.com/showthread.php?p=199700#post199700

    So it’s not that WP has a bug or that anything’s wrong, it’s just server shenanigans.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Internal server error 500 multisite redirect’ is closed to new replies.