Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Fix YOURLS 404 Errors on Short Links

A YOURLS 404 is usually a server-routing problem. Follow this Apache and Nginx checklist to correct rewrite rules, root or subdirectory paths, permissions, PHP-FPM and conflicting applications.
Length10 min Posted Quest giverVGSources Team

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A YOURLS short URL that returns 404 Not Found is almost always a web-server routing problem, not a defect in YOURLS. The fix is to make the server load YOURLS’s rewrite rules and send unknown paths to yourls-loader.php. On Apache, that means enabling mod_rewrite, using a YOURLS-only .htaccess, and allowing overrides with AllowOverride All. On Nginx, it means adding a try_files fallback and passing PHP requests to PHP-FPM. Root-domain and subdirectory installations use different paths, and a conflicting application, proxy, permission error, or virtual-host rule can still produce a 404.

Work through the checks below in order. Do not replace rewrite rules blindly: first identify whether the 404 is generated by the web server, a proxy, or YOURLS itself.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a YOURLS 404 means

YOURLS creates short paths that do not correspond to physical files. When someone visits a short URL, the web server must pass that path to YOURLS rather than looking for a real directory or file with the same name. A 404 means that hand-off did not happen.

The YOURLS Contributors’ Frequent issues documentation states: “If you experience ‘404 not found’ instead of a redirection when you follow a short URL, this is not a bug. It’s a configuration problem on your end.” In practice, the faulty setting is usually in the server’s rewrite configuration, virtual host, PHP connection, file permissions, or a proxy in front of the server.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

First, confirm the exact symptom

  1. Open a short URL that previously worked, or create one from the YOURLS administration screen if the admin interface is available.
  2. Open that short URL directly in a private browser window. A valid request should redirect to its long destination.
  3. Record the status page and wording. “404 Not Found” from the web server is different from a YOURLS-generated response, a reverse-proxy error, or a custom application page.
  4. Test the administration URL and the YOURLS home URL separately. If the admin works but every short path fails, the installation is probably running and the rewrite route is the part that is broken.

Do not treat a mistyped short key, an expired destination, or an unrelated application page as proof that all rewrite rules are failing. Test a known-good key and compare the responses.

Apache: the required pieces

An Apache installation needs three things working together: mod_rewrite, a YOURLS-specific .htaccess file, and permission for Apache to read and apply that file. Missing any one of them can leave the admin page usable while short links return 404.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

1. Verify mod_rewrite

Ask the host administrator or inspect the Apache module configuration to confirm that mod_rewrite is enabled for the active server. Enabling it in one Apache installation does not help if the domain is served by a different virtual host, container, or managed hosting layer. Check the virtual host that actually handles the short-link domain.

2. Give YOURLS its own rewrite file

The YOURLS Server configuration documentation says that YOURLS cannot share its root directory with another application driven by .htaccess rewrite rules, such as WordPress. The file should contain YOURLS directives and no other rewrite rule.

This restriction matters because rewrite processing is order-sensitive. Another application may catch the short key first, send the request to its own front controller, or issue a 404 before YOURLS sees it. Remove unrelated rules from the YOURLS directory, or move YOURLS to a dedicated domain or a separate subdirectory with its own rewrite scope.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

3. Check the override policy

Apache must be allowed to apply .htaccess directives for the directory containing YOURLS. The YOURLS Frequent issues FAQ specifically names AllowOverride All. If overrides are disabled, the file can exist with correct contents and still have no effect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the applicable <VirtualHost> and <Directory> blocks, not only a global Apache configuration. A hosting control panel may expose this as an “Allow overrides,” “Use .htaccess,” or similar setting. After changing the virtual-host configuration, reload or restart Apache according to the host’s procedure and retest a short URL.

4. Match the rewrite base to the installation location

The base path and loader path must describe the URL location where YOURLS is installed. A root-domain installation and a subdirectory installation are not interchangeable.

Installation Rewrite base Loader target for non-files and non-directories Typical mistake
Root of the domain RewriteBase / /yourls-loader.php Using a subdirectory path copied from another installation
Subdirectory, such as /somedir/ RewriteBase /somedir/ /somedir/yourls-loader.php Leaving the base at / or omitting /somedir/ from the loader path

For a root install, the YOURLS rules should send requests that are neither existing files nor existing directories to /yourls-loader.php. For an installation under /somedir/, they should use /somedir/yourls-loader.php. Preserve the rest of the YOURLS directives supplied for your version; changing only the path when moving an installation is safer than combining rules from another application.

5. Confirm that Apache can read the file

If YOURLS could not create its .htaccess automatically, check filesystem ownership and permissions. The web-server account must be able to read the file and traverse the directories leading to it. A file that is present but unreadable can behave like a missing rewrite configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

After correcting permissions, verify the file at the actual document root used by the virtual host. It is common to edit a copy in a staging directory while production traffic is served from another directory.

Nginx: route unknown paths to YOURLS

Nginx does not process Apache .htaccess files. Its rewrite behavior belongs in the server or location configuration, and PHP must be handed to PHP-FPM. The YOURLS Server configuration documentation gives this pattern inside the relevant location / block:

try_files $uri $uri/ /yourls-loader.php$is_args$args;

The first two arguments preserve real files and directories. The final argument sends a short key, which is normally neither, to YOURLS while retaining the query string.

Root-domain Nginx installation

  1. Place the try_files directive in the location / block for the domain serving YOURLS.
  2. Use /yourls-loader.php$is_args$args as the fallback when YOURLS is installed at the domain root.
  3. Ensure the PHP location passes yourls-loader.php and other PHP requests to the configured PHP-FPM socket or upstream.
  4. Reload Nginx using the host’s normal configuration procedure, then request a known-good short URL again.

Subdirectory Nginx installation

When YOURLS lives below a path such as /subdir/, include that path in the fallback:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
try_files $uri $uri/ /subdir/yourls-loader.php$is_args$args;

The location matching and PHP-FPM rules must also cover that subdirectory. A root fallback sends the request to the wrong filesystem or application and commonly results in a 404 even though the YOURLS files are present.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Check PHP-FPM separately

A missing PHP-FPM hand-off can look like a rewrite failure. If static files load but PHP requests return an upstream error, blank response, or a different 404 page, inspect the Nginx error log and PHP-FPM log. Confirm that the configured document root contains the loader file and that the Nginx user can reach it.

Root domain versus subdirectory: choose and verify one path

YOURLS can run at a dedicated domain root or below a path on an existing domain. The choice affects every layer that sees the request: DNS and the virtual host, the document root, Apache’s RewriteBase or Nginx location, the loader fallback, and any reverse proxy in front of the web server.

Check Root-domain install Subdirectory install
Example public URL https://short.example/abc123 https://example/somedir/abc123
Apache base RewriteBase / RewriteBase /somedir/
Apache loader path /yourls-loader.php /somedir/yourls-loader.php
Nginx fallback /yourls-loader.php$is_args$args /somedir/yourls-loader.php$is_args$args
Most common path error Rules point to a former subdirectory Rules omit the subdirectory in one location or fallback

Do not mix a root-domain URL with subdirectory rules copied from a previous server. If the installation was moved, search the active configuration for the old directory name and update every matching rewrite or location entry.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep YOURLS away from competing rewrite applications

A 404 that appears only after installing or updating another application often indicates a rewrite conflict. WordPress and similar front-controller applications may own the same document root and its .htaccess file. Their rules can intercept a YOURLS key before the request reaches the YOURLS loader.

Reliable layouts

  • Use a dedicated short-link domain whose document root contains YOURLS and its own rewrite configuration.
  • Use a clearly separated subdirectory and configure its base and loader path consistently.
  • Do not append unrelated rewrite blocks to the YOURLS .htaccess file.
  • If a reverse proxy routes several applications, send the short-link host or path to the YOURLS backend before the general application route.

The YOURLS documentation cautions that server configuration differs from one installation to another. That is why copying a rule set from a different host can make the problem worse: its document root, PHP handler, path prefix, or proxy order may not match yours.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use logs and response details to locate the failing layer

Once the basic routing is in place, logs provide the evidence needed to distinguish a bad rule from a bad file path or an upstream failure.

Web-server access and error logs

Review the access log entry for the exact short URL and the corresponding error log entry at the same time. Look for the virtual host that handled the request, the requested URI, the selected document root, and whether Nginx or Apache attempted the loader file. A request reaching the wrong virtual host usually means DNS, host-name matching, or proxy routing is wrong rather than the YOURLS rule itself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Browser developer tools

Open the browser’s developer tools, select the request for the short URL, and inspect the status code, response headers, and redirect history. This can reveal a proxy-generated 404, a redirect to an unexpected host, or a response served by another application. Request the loader endpoint directly as a diagnostic, while remembering that the loader is not intended to be the public destination for ordinary visitors.

Compare a working and failing request

If the administration page works, compare its host, scheme, and path with the short URL. Differences often expose a second virtual host, an HTTP-to-HTTPS proxy rule, or a path prefix that was not included in the rewrite configuration. If both the home page and admin page fail, verify the document root and PHP handler before changing short-link rules.

Permissions, proxies, and virtual-host checks

  • Permissions: Confirm that the web-server account can traverse the YOURLS directories, read .htaccess on Apache, and read yourls-loader.php.
  • Virtual host: Confirm that the short-link hostname resolves to the server and matches the virtual host containing YOURLS. A default host can return a perfectly valid 404 for the wrong site.
  • Proxy or CDN: If a proxy sits in front of Apache or Nginx, inspect its route and cache behavior. A cached 404 can remain after the origin is fixed; purge or bypass the cache according to that service’s procedure.
  • HTTPS termination: Make sure the proxy forwards the request to the intended backend and does not strip or add a path prefix unexpectedly.
  • PHP-FPM: On Nginx, verify both the socket/upstream and the filesystem path used for PHP scripts. A rewrite can be correct while the loader still cannot execute.
  • Recent migrations: Recheck every path after moving domains, changing document roots, or switching from Apache to Nginx. The old base path may remain in one server block or deployment template.

A complete recovery sequence

  1. Reproduce the failure. Use a known-good short URL and record the exact 404 page, status, host, and path.
  2. Identify the serving layer. Use response headers, browser developer tools, and access logs to determine whether the response comes from a proxy, Apache, Nginx, or an application.
  3. Confirm the installation path. Decide whether YOURLS is at the domain root or under a specific subdirectory, then verify the active document root.
  4. Apply the server-specific requirements. On Apache, verify mod_rewrite, a YOURLS-only .htaccess, and AllowOverride All. On Nginx, add the matching try_files fallback and PHP-FPM hand-off.
  5. Correct the loader path. Use /yourls-loader.php at the root or include the complete subdirectory in both the rewrite base and loader target.
  6. Remove rewrite conflicts. Separate YOURLS from WordPress or any other application that owns the same rewrite file or front-controller route.
  7. Check permissions. Ensure the server can read the rewrite file and loader and traverse their parent directories.
  8. Reload the service. Apply the changed virtual-host, server, or proxy configuration using the host’s supported reload process.
  9. Retest without stale cache. Use a private browser window and inspect the new response, then test from a second network if a proxy or CDN may be caching the old result.
  10. Recheck logs. If the 404 remains, follow the new request in the access and error logs. The failing virtual host, location, filesystem path, or upstream will determine the next correction.

Deployment choices that affect troubleshooting

Neither Apache nor Nginx is automatically the correct answer. The practical choice depends on which configuration you control and where your logs live.

Deployment factor Apache Nginx
Rewrite model mod_rewrite plus a YOURLS-specific .htaccess Server/location configuration with try_files
Per-directory overrides Requires overrides to be permitted; the FAQ names AllowOverride All No .htaccess processing; edits require server-block access
Root/subdirectory handling Change RewriteBase and the loader path together Change the fallback path and matching location together
PHP execution Depends on the configured Apache PHP handler Requires a working PHP-FPM socket or upstream
Typical access needed Directory configuration and readable .htaccess Permission to edit and reload the virtual-host/server block
Most useful evidence Apache access/error logs and the active .htaccess Nginx access/error logs, server block, and PHP-FPM logs

The documentation does not identify a universal configuration because virtual hosts, permissions, proxies, and application layouts vary. If you cannot edit the relevant server block or override policy, provide your host’s support team with the exact short URL, timestamp, response, and log entry instead of repeatedly changing application files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When the fix is not a rewrite rule

Stop editing rewrite directives when the evidence points elsewhere. A 404 from the wrong virtual host, a proxy cache, an unreadable loader file, or a failed PHP-FPM upstream will not be repaired by changing RewriteBase. Likewise, if only one key fails while other known-good keys redirect, investigate that key’s existence and destination rather than replacing the entire server configuration.

Once the request reaches YOURLS and the loader executes, a successful short-link request should produce a redirect to its stored long URL. If the response still does not redirect, preserve the server logs and inspect the application-level response; the original web-server routing problem has then been separated from any remaining YOURLS data or runtime issue.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.