I already have two articles on my blog then I decided to share them through Facebook. The thumbnail and the shared link returned an “error 404 page not found”. To troubleshoot it you need to login into your WordPress admin console. This has something to do with the permalink and .htaccess on your server.

Step 1. Login to your blog/wp-admin console

Step 2. Navigate through the left-hand tool panel. Hover over Settings > Permalink

Step 3. Without changing anything, click save as and check if the links are working, if still broken link select another option and follow the warning message.

Step 4. Access your VM and navigate to /var/www/html . This is important to understand, “.htaccess” should be on that directory together with wp-content and wp-inlude. If not, you should create the file and paste the <IfModule mod_rewrite.c> (from step 3) inside it.

Step 5. Assign a 666 permission to .htaccess file. It should be a rw-rw-rw

Step 6. Run commands a2enmod rewrite and apache restart

Step 7. Go back to wp-admin console and check permalinks. You should be able to select any options in there and be applied to the posts you created. There should be no warning messages about .htaccess

Step 9. Check shared links and thumbnail. Error 404 should now be fixed.