Created
December 3, 2025 13:04
-
-
Save abdulawal39/0217e27ecbed359394948e231d8902c0 to your computer and use it in GitHub Desktop.
Revisions
-
abdulawal39 created this gist
Dec 3, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ /** * Custom Redirects for WFAM */ $request_uri = $_SERVER['REQUEST_URI']; $request_path = strtok($request_uri, '?'); // Match: /wp-content/uploads/anything.extension if (preg_match('#^/wp-content/uploads(/.*\.\w+)$#', $request_path, $matches)) { // Set the query parameter $_GET['wfam_requested_file'] = $matches[1]; $_REQUEST['wfam_requested_file'] = $matches[1]; // Include WordPress require_once(__DIR__ . '/index.php'); exit; }