How to Fix OpenCart 404 Page Not Found Error?

Fix OpenCart Page Not Found


OpenCart is a free e-commerce online platform with a wide range of features. It is based on PHP using MySQL database and HTML components. OpenCart offers a user-friendly interface and helps the shop owners to launch an online store. It is robust and search engine friendly that can be optimized easily to use in several search engines.

OpenCart 404 Page Not Found Error:

OpenCart 404 Page Not Found error is caused due to a broken link or undefined URL. This error occurs mostly on the product and category pages. Most people may experience this error on all the associated pages after a fresh installation. This error can be rectified by adding a code in the .htaccess file. This tutorial helps to fix OpenCart 404 Page Not Found error easily.

Steps to Fix OpenCart 404 Page Not Found Error:

Follow the below steps to resolve 404 Page Not Found error by adding the code in .htaccess file.

Step 1: Login to your hosting control panel.

Step 2: Go to your root directory. And locate the file ‘.htaccess’

Step 3: Now, open and edit the file ‘.htaccess’ of your OpenCart installation

Locate htaccess file

Step 4: Add the below code in the top of the .htaccess file to fix the 404 page not found error.

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch “.(tpl|ini|log)”>
Order deny,allow
Deny from all

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
RewriteRule ^sitemap.xmlindex.php?route=feed/google_sitemap
RewriteRule ^googlebase.xmlindex.php?route=feed/google_base
RewriteRule ^download/(.*) /index.php?route=error/not_found
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1

Step 5: Now, click ‘Save Changes’ and then check again.

The error 404 Page Not Found will be resolved now. We hope that this tutorial will be helpful to fix the Page Not Found error in OpenCart. For more information, follow us on Twitter and Facebook and For video tutorials, subscribe to our YouTube channel ServerCake India.


Please enter your comment!
Please enter your name here