I encountered this problem on a localhost install of Drupal 8 on Ubuntu18.04.
I could see the base url page but every link into my site was 404 (e.g. any link from the admin bar).
Clean URLs
I started with the Drupal.org page, "Page Not Found" Errors on every page except homepage where I found this:
To configure mod_rewrite from .htaccess, the Apache config needs to
allow at minimum "FileInfo" overrides. In order to make the simple
DirectoryIndex test work, apache needs to allow "Index" overrides.
Then I found a solution which translated this for me into practical steps. I enabled "Clean URLS", following a hint on Install Drupal on Ubuntu 18.04 Bionic Beaver Linux.
edit Apache's default site configuration
/etc/apache2/sites-enabled/000-default.conf
$ sudo vim /etc/apache2/sites-enabled/000-default.conf
insert the following just after the line that has DocumentRoot
/var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
restart Apache
$ sudo systemctl restart apache2
?q=admin
would it?