My main dev computer had a hard drive failure and I had to reinstall the whole OS and software on a new drive. After getting things back up and running, I am having a strange problem with both Backdrop and Drupal: the sites' home pages load (although without theming) but the rest of the site pages give 404. I can't log in as that page also gives a 404.

I decided to start debugging on the Backdrop site since that is cleaner. I have checked the dir permissions and all looks good there. It is an exact copy of the dev copy of my site that was working fine before the HDD failed. bee status gives a clean result.

Looking at the browser console, I see the following errors:

  1. Refused to apply style from 'http://localhost/backdrop1/' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
  2. Refused to execute script from 'http://localhost/backdrop1/' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
  3. http://localhost/backdrop1/files/js/js_4jj50hOWtZtBpDbHSVX8pigOpY6YLT5le-95LBqzcts.js:27 Uncaught ReferenceError: jQuery is not defined
       at js_4jj50hOWtZtBpDbHSVX8pigOpY6YLT5le-95LBqzcts.js:27:4

A Drupal issue thread I found suggests that turning off css/ js file aggregation might fix the second problem, but I don't know how I could even try that without being able to log in.

Any suggestions?

Accepted answer

The info at that doc page did not work, i.e. just  adding AllowOverride All did not enable clean URLs on my site.

I had to add another directive to my local httpd config directory to get clean URLs to work. I put them all into a single file in the /etc/httpd/conf.d directory.

The contents:

# To allow .htaccess directives to take effect

<Directory "/var/www/html">
   Options Indexes FollowSymLinks
   AllowOverride All
</Directory>

I found this info in an old doc that gave the source as  https://www.drupal.org/docs/develop/local-server-setup/linux-development-environments/installing-php-mysql-and-apache-under. That link is dead now, though.

Oh, also on RHEL / Fedora / CentOS the command to check for enabled Apache modules is

httpd -M

Comments

I was able to resolve the console errors (all 3) and related theming problems by doing the proper SELinux config to the files directory, i.e.

sudo chcon -R -t httpd_sys_content_rw_t /var/www/MYSITE/files/

See: https://www.drupal.org/node/50280 

However, the main problem of not being able to log in or access site pages other than the home page is still there. 😣

IDK why I missed this on my earlier searching, but this post appears to be the same or at least a very similar problem: https://forum.backdropcms.org/forum/404-error-everything-front-page

Yes, clean URLs are no longer working. I can confirm that I can log in by using the ugly (unclean?) URL for the login page i.e. https://example.com/?q=user/login 

I will check the page on setting up the server for clean URLs and see if I can fix it....

Oh, that page is https://docs.backdropcms.org/documentation/clean-urls-1 

The info at that doc page did not work, i.e. just  adding AllowOverride All did not enable clean URLs on my site.

I had to add another directive to my local httpd config directory to get clean URLs to work. I put them all into a single file in the /etc/httpd/conf.d directory.

The contents:

# To allow .htaccess directives to take effect

<Directory "/var/www/html">
   Options Indexes FollowSymLinks
   AllowOverride All
</Directory>

I found this info in an old doc that gave the source as  https://www.drupal.org/docs/develop/local-server-setup/linux-development-environments/installing-php-mysql-and-apache-under. That link is dead now, though.

Oh, also on RHEL / Fedora / CentOS the command to check for enabled Apache modules is

httpd -M