Issue
- 404 Error occurs when accessing sub-directories, but the homepage works well.
Reason
- .htaccess file is missing.
Solution 1:
> Automatically create the file via the wp-admin portal.
Solution 2:
> Manually create a .htaccess file with permission 744. Contents are as below
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>