I recently upgraded one Magento installation on my local from 2.3.6-p1 to 2.4.2, and then I started getting 404 error for all pages on front end and backend, below are the technical details of server, and few tries I already made:
values set in httpd.conf (as I run multiple websites so I place them in subdirectory of /var/www/html)
Listen 192.168.1.119:80
Timeout 600
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride All
Order allow,deny
Allow from all
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/html">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
root .htacces file:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* pub/$0 [L]
DirectoryIndex index.php
</IfModule>
Note: I added ifmodule statement here to confirm that mod rewrite is installed and working.
I have cleared all cache and generated folders using the command below:
rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/
and then recompiled and deployed, but not working for me, can anyone help me for the same.