• Resolved wlpdrpat

    (@wlpdrpat)


    Hi, I’m curious about a redirect situation that I have encountered. Last year I migrated all of the sub-sites of an old multisite to a fresh multisite.

    The old multisite uploads URL structure as /files/year/month/filename.jpg

    The new multisite uploads URL structure is /wp-content/uploads/sites/sitenumber/filename.jpg

    I’ve tried 2 regex redirects and neither work. I also tried a standard page redirect. In all cases, I continue to get a WordPress > Error > There has been a critical error on this website.

    First attempt with Regex:

    ^/files(.*)
    /wp-content/uploads/sites/16$1

    Second Attempt with Regex:

    ^/files/(.*)
    /wp-content/uploads/sites/16/$1

    Third Attempt with standard page redirect:

    /files/2013/10/filename.pdf
    
    /wp-content/uploads/sites/16/2013/10/filename.pdf

    I figure this is some type of WordPress issue but I am hoping that you have a workaround.

    Thanks,

    Pat

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Godley

    (@johnny5)

    I would investigate what the critical error is, possibly through your server error log.

    You may find some clues for the file uploads here:

    https://redirection.me/support/problems/url-not-redirecting/

    Thread Starter wlpdrpat

    (@wlpdrpat)

    @johnny5

    Here is the fatal error:

    PHP Fatal error: Uncaught Error: Undefined constant “BLOGUPLOADDIR” in /public_html/wp-includes/ms-files.php:26
    Stack trace:

    0 {main}

    thrown in /public_html/wp-includes/ms-files.php on line 26

    Any thoughts?

    Pat

    Thread Starter wlpdrpat

    (@wlpdrpat)

    @johnny5 Funny, upon Googling that error I found that I reported it about 9 months ago when I initially migrated from the old to the new version of multisite and was trying to debug any errors. Unfortunately, I didn’t get any responses at that time and noticed that the reoccurrence of the error started to diminish over time. So, I just let it go. Now, that I am trying to redirect the old upload directories I’ve found what was causing that recurrent error but I still don’t have a solution.

    Plugin Author John Godley

    (@johnny5)

    The error does not seem connected to Redirection.

    Have you looked at https://redirection.me/support/problems/url-not-redirecting/ ?

    This seems like a similar issue since 5.9 to this:
    https://core.trac.www.ads-software.com/ticket/55067

    When PHP files are accessed that are not intended to be accessed directly it throws an Undefined constant “ABSPATH” error or similar server error 500 issue on the server. It doesn’t sound like it is a big issue and more of an annoyance in the error log files. However, the problem is that it shows as a fatal error which doesn’t seem like a great solution to just ignore or handle at the server level vs properly coding to check & ignore direct non-accessible files.

    • This reply was modified 1 year, 1 month ago by umduck.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirecting Uploads Multisite’ is closed to new replies.