404 Error on Fresh Install

Mistakenly posted this on the Issue Tracker. Moving it here! Because I’m fekkin’ confused.

Describe the bug
Upon installing YOURLs, all created shortlinks fail with a 404.

To Reproduce
Steps to reproduce the behavior:

  1. Install YOURLs, with complete successful install (No Debug errors or install errors)
  2. Open Admin toolbar
  3. Select one of the three preloaded shortlinks, or a new created shortlink
  4. Open URL in new tab
  5. URL 404s.

Expected behavior
URL links to the indicated link.

Actual behavior
URL Link fails with a 404 Not Found error.

Admin Dashboard with Links, 404 Error Given: https://imgur.com/a/RszU8GC


  • OS: Ubuntu 18.04.3 LTS
  • Browser: FireFox 70.0.1
  • Web Server: Apache2
  • PHP Version: 7.2.24
  • MySQL Version: 14.14
  • YOURLs version: 1.7.4

Additional context
I know this error has been discussed before, however, I’m almost certain that I’ve tried everything suggested. Read through open and closed issues on the topic.

Attached files:
Access.log, YOURLS config, web server config, and HTACCESS.

Also of note, the site is enabled on CloudFlare. I don’t think this should do anything but, hey. Info is Info. All files in the /var/www/hsshort directory is owned by www-data, recursively. The YOURLs instance is hosted on the same machine as two other sites, but the YOURLs directory/area is in it’s own section.

Server does have mod_rewrite enabled, as well as the correct .htaccess from the example on the wiki for a root directory install.

Hello @Rixxan, thanks for your message and sorry for late reply.

Did you find a solution is the mean time?
It mostly seems to be a Apache httpd misconfiguration.
I suggest you contact your host to get assistance on how to rewrite URL pointing to this directory.

Hello @LeoColomb,

I found the issue a day or two ago - or at least found a way that it works.

Removing the following line from my .htaccess caused it to work: RewriteCond %{HTTPS} !=on

Remove that, it worked fine.

Thanks for the help, anyways! Sometimes you just need to talk through an issue to get it to work.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.