{"id":20936552,"url":"https://github.com/vr51/fix-missing-files","last_synced_at":"2026-02-09T08:34:59.816Z","repository":{"id":77656404,"uuid":"84596014","full_name":"VR51/Fix-Missing-Files","owner":"VR51","description":"Serve replacement files when requests are made for non existent documents.","archived":false,"fork":false,"pushed_at":"2017-03-27T18:15:28.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-25T17:44:58.663Z","etag":null,"topics":["404","apache","htaccess"],"latest_commit_sha":null,"homepage":"https://journalxtra.com/web-development/fix-missing-file-404-requests/","language":"ApacheConf","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VR51.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-10T19:57:58.000Z","updated_at":"2017-03-11T00:28:21.000Z","dependencies_parsed_at":"2023-02-26T01:15:21.682Z","dependency_job_id":null,"html_url":"https://github.com/VR51/Fix-Missing-Files","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VR51/Fix-Missing-Files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VR51%2FFix-Missing-Files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VR51%2FFix-Missing-Files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VR51%2FFix-Missing-Files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VR51%2FFix-Missing-Files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VR51","download_url":"https://codeload.github.com/VR51/Fix-Missing-Files/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VR51%2FFix-Missing-Files/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29260070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["404","apache","htaccess"],"created_at":"2024-11-18T22:20:48.030Z","updated_at":"2026-02-09T08:34:59.797Z","avatar_url":"https://github.com/VR51.png","language":"ApacheConf","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fix-Missing-Files v0.0.2\nServe replacement files when requests are made for non existent documents i.e. fix 404 errors with a one-size-fits-all patch.\n\n## Notes\n\n- This solution for fixing 404 errors is intended to be used as a quick-fix when other solutions are impractical to apply.\n- This solution is not intended to be used to serve 404 error pages though it can be used this way if necessary.\n\n## Instructions\n\n- Download the directory called 'missing'.\n- Upload the 'missing' directory to your site's document root (normally under public_html).\n- Unpack the uploaded package.\n- Make sure 'missing' is directly under public_html\n- Copy the .htaccess directives in the 'missing' directory to the .htaccess file immediately under public_html.\n\n## For reference\n\nThe .htaccess directives to be added to the root .htaccess file are:\n\n```\n## Fix missing image and file requests\n## Version 0.0.2\n## Change each of the {REQUEST_URI} lines in each directive set to specify the missing file 404 requests to check against.\n## The replacement file(s) to serve should go into a server directory called \"missing\" located under public_html/\n## Image formats go into the Image Set. No file required to be added to the 'missing' directory\n## Other formats go into the File Set. Place an empty text file with correct extension into the 'missing' directory\n## See https://journalxtra.com/web-development/fix-missing-file-404-requests/\n \n## Image Set: Fix Bad Image Requests\nRewriteCond %{REQUEST_FILENAME} !-f\n## Ignore any real files (404s will not occur if the file actually exists)\n## Add image file types to check against here\nRewriteCond %{REQUEST_URI} .(gif|jpe?g|png|bmp|tiff|xcf|psd|ico)$ [NC]\n## Specify the file to serve instead\nRewriteRule .* /missing/missing.gif [L]\n \n## File Set: Fix Bad File Requests\n## Ignore specific virtual file(s)\nRewriteCond %{REQUEST_URI} !^/robots.txt/?$ [NC]\n## Ignore any real files (404s will not occur if the file actually exists)\nRewriteCond %{REQUEST_FILENAME} !-f\n## Add file types to check here.\n## Put a replacement document in the \"missing\" directory for each specified file type.\n## The replacement document can be an empty text file but with the same extension type as the file it is served in place of.\nRewriteCond %{REQUEST_URI} .(css|html?|js|php|shtml|svg|txt)$ [NC]\nRewriteRule .* /missing/missing.%1 [L]\n```\n\n## Files in the Missing directory\n\nThese are the files in the 'missing' directory. These are served when 404s are encountered. These are empty files. If you wish you can replace them with non-empty files to serve when missing files are encounted but I advise against it.\n\n- missing.gif (1px square)\n- missing.css (empty text file)\n- missing.htm (empty text file)\n- missing.html (empty text file)\n- missing.js (empty text file)\n- missing.php (empty text file)\n- missing.shtml (empty text file)\n- missing.svg (empty text file)\n- missing.txt (empty text file)\n\n# Warnings and Notes\n\nIf you use a CMS that creates virtual files be careful not to add those virtual file formats to the list of formats to check against or at least whitelist specific virtual files with a directive instructing the server to ignore the files (see comments within the File Set directives for an example of whitelisting).\n\n## WordPress Virtual File Formats\n\nThese are virtual files and file formats encountered by me:\n\n- xml (created by Jetpack and SEO plugins)\n- robots.txt (created by SEO plugins)\n\n## URL Slugs\n\nIf your URLs end with .html or another of the extensions checked in the File Set you will need to remove the extension from File Set.\n\nFor example, some WordPress sites use .html at the end of their permalinks. Usually a hangover from a migrated site. The rewrite condition in the File Set would be as follows for sites with such URL slugs:\n\n```\nRewriteCond %{REQUEST_URI} .(css|js|php|shtml|svg|txt)$ [NC]\n```\n\n# Changelog\n\n\n0.0.2 - 13th March 2017\n\n- Minor readme.md changes\n- Moved svg to File Set from Image Set\n\n0.0.1 - 10th March 2017\n\n- First public release\n\n# More info\n\nVisit [https://journalxtra.com/web-development/fix-missing-file-404-requests/](https://journalxtra.com/web-development/fix-missing-file-404-requests/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvr51%2Ffix-missing-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvr51%2Ffix-missing-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvr51%2Ffix-missing-files/lists"}