In WordPress and Joomla website .htaccess files are used to ensure that the pages redirect properly to links created using the CMS.
If this is not enabled at the server level for /var/www/html, even if mod_rewrite is enabled (which it is on CentOS 7 by default), you will get a 404 error.
First, ensure mod_rewrite is actually enabled in the first place.
httpd -M | grep rewrite
If you see:
It is enabled so on to the next step by editing /etc/httpd/conf/httpd.conf.
In the following section between <Directory “/var/www/html”> and </Directory>
Then restart Apache:
systemctl restart httpd.service
You should now be able to navigate using your WordPress site correctly.