We have a 404 issue on all product pages. Category pages showing fine as they should. Having imported circa 4000 products directly into our Magento2 store database and uploading images directly to the media folder, I realise we have omitted the correct steps for Magento2 in that we have not used the inbuilt import function. Thus the URL rewrite function has not ran.
When we create a new product manually from the Magento admin, the same issue occurs though. We have a 404 error in the frontend for the URL that is created. We can see the URL's are creating in the catalog_url_rewrite_product_category and url_rewrite tables.
We have re-ran below list of queries on command line to try to rectify:
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US en_GB
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush
And reset permissions as per below guide:
We are running the latest version of Magento 2.1.6 having upgraded recently to see if this solves the issue.
My feeling is that there is something corrupt in the database, but unsure how to debug further. And/or it's a permission issue as our cron is not running currently too which is another issue we are looking to fix today.
Any help and guidance would be greatly appreciated. Thanks.