404 Troubleshooting guide with LifterLMS
When a 404 error message pops up, it simply means the server can’t find the file the user requests. This means your server is accessible and there’s really nothing wrong with your website but the requested resource(image, video or text) cannot be found.
Now that we know the meaning of Error 404, let’s check out how to resolve the issue.
1. Save Permalinks to Fix WordPress Error 404
Most times, a simple permalinks save will clear out any 404 Error you have. A permalinks save will update your .htaccess file with the correct configurations for your WordPress site
In order to save permalinks, simply go to Settings >> Permalinks and click on the “save changes” button as shown in the screenshot below:
Now, try accessing your course/post and see if this fixes the issue.
2. Manually Reset Permalinks
Sometimes, saving permalinks does not work. This is where you’ll need to manually reset the permalinks. To do this, access your website files using FTP. When connected via FTP, locate your .htaccess file and edit it.
Depending on how your site is structured, that is if your site is in the main domain, subdomain or directory then you will need different set of codes to be inserted in the .htaccess file.
A) Reset permalinks when your site is in the main domain
If your site is on the main domain, e.g. www.lifterlms.com then you’ll need to use this code for your .htaccess file.
# 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>
# END WordPress
After doing this, check again to see if you can now find your course/posts.
B) Reset permalinks if your site is in a subdomain and fix WordPress 404 Error
If your site is on a subdomain, e.g. academy.lifterlms.com then you’ll need to use this code for your .htaccess file.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
After doing this, check again to see if you can now find your course/posts.
C) Reset permalinks when your site is in a subdirectory
If your site is on a subdirectory, e.g. lifterlms.com/directory then you’ll need to use this code for your .htaccess file.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
After doing this, check again to see if you can now find your course/posts.
If you still can’t access your course/page/post after doing any of the above then you need to be sure if the page actually exists on your dashboard. Sometimes, it may not exist anymore or the URL may have changed from what it used to be.
Simply put, you need to check your dashboard and make sure the resource(page, image, video etc.) actually exists.