Title: Redirecting Uploads Multisite
Last modified: June 18, 2023

---

# Redirecting Uploads Multisite

 *  Resolved [wlpdrpat](https://wordpress.org/support/users/wlpdrpat/)
 * (@wlpdrpat)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirecting-uploads-multisite/)
 * 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:
 *     ```wp-block-code
       ^/files(.*)
       /wp-content/uploads/sites/16$1
       ```
   
 * Second Attempt with Regex:
 *     ```wp-block-code
       ^/files/(.*)
       /wp-content/uploads/sites/16/$1
       ```
   
 * Third Attempt with standard page redirect:
 *     ```wp-block-code
       /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](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirecting-uploads-multisite/#post-16828376)
 * 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/](https://redirection.me/support/problems/url-not-redirecting/)
 *  Thread Starter [wlpdrpat](https://wordpress.org/support/users/wlpdrpat/)
 * (@wlpdrpat)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirecting-uploads-multisite/#post-16828403)
 * [@johnny5](https://wordpress.org/support/users/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](https://wordpress.org/support/users/wlpdrpat/)
 * (@wlpdrpat)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirecting-uploads-multisite/#post-16828418)
 * [@johnny5](https://wordpress.org/support/users/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](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/redirecting-uploads-multisite/#post-16828445)
 * The error does not seem connected to Redirection.
 * Have you looked at [https://redirection.me/support/problems/url-not-redirecting/](https://redirection.me/support/problems/url-not-redirecting/)?
 *  [umduck](https://wordpress.org/support/users/umduck/)
 * (@umduck)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/redirecting-uploads-multisite/#post-17141946)
 * This seems like a similar issue since 5.9 to this:
   [https://core.trac.wordpress.org/ticket/55067](https://core.trac.wordpress.org/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 2 years, 7 months ago by [umduck](https://wordpress.org/support/users/umduck/).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Redirecting Uploads Multisite’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [umduck](https://wordpress.org/support/users/umduck/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/redirecting-uploads-multisite/#post-17141946)
 * Status: resolved