Check our Summer Specials! Get a Free Account or SEO Bundle with 80% off. View Offers

OpenCart 2 Search Engine Friendly URLs

How to configure OpenCart 2 .htaccess file and activate SEO URLs

Search engine friendly (SEF), human-readable or clean URLs are URLs that make sense to both humans and search engines because they explain the path to the particular page they point to. Using SEF URLs you can convert the standard URLs such as:

 

http://mydomain.com/index.php?route=product/category&path=20

 

to their SEO equivalent:

 

http://mydomain.com/laptop-notebook

 

OpenCart 2 SEO friendly URLs require mod_rewrite and rewrite rules which are included in the OpenCart 2 .htaccess file.

 

mod_rewrite

mod_rewrite and OpenCart 2 SEO URLs are fully supported on all FastComet OpenCart 2 Hosting plans. If you experience any difficulties to activate this feature for your store, please contact our technical support for assistance.

 

To activate the OpenCart 2 SEO URLs, please follow the steps below:

Step 1 Configure your OpenCart 2 .htaccess File

By default OpenCart 2 installation archive contains a file called .htaccess.txt. This file contains all the necessary rewrite rules to have the SEO URLs working. First, you will need to rename the file and change its name from:

 

 .htaccess.txt

 

to

 

 .htaccess

 

Please mind the dot "." before the name of the file, you should not remove it from the name but only the ".txt" extension of the file. You can rename this file both on your local computer and upload the file later or directly on your hosting account via FTP or using your hosting account control panel. For more information on how to upload and modify on your account via FTP, please refer to our FTP Tutorial.

 

Additionally, if your OpenCart 2 store is located under a subdirectory of your account you will need to edit the RewriteBase like in the .htaccess file. To do so, please open the .htaccess file on and locate the following line:

 

RewriteBase /

 

In case your store is under the root of your domain name (ex: example.com) you do not need to change this line. However, if your OpenCart 2 is installed under a subfolder (ex: example.com/store/) you will need to modify the line to:

 

RewriteBase /store/

 

When you have the correct RewriteBase set, please save the file and make sure it is properly uploaded under the root of your OpenCart 2 web directory.

 

Step 2 Activate the SEO URLs

To finalize the process, please login your OpenCart 2 admin dashboard and refer to the Settings section via the navigation menu.

 

OpenCart 2 SEO settings

 

From the store list, please click on the edit icon and refer to the Server tab from the top navigation.

 

OpenCart 2 Enable SEO URLs

 

From the Server tab locate the Use SEO URLs radio button and set it to 'Yes'. When you are ready with your configuration settings save your changes and check your OpenCart store frontend to make sure that the SEO URLs are properly working.

 

In case you experience any difficulties, please verify that your .htaccess file is properly uploaded under the OpenCart 2 installation directory and the correct RewriteBase is set in the file.