Learn Opencart 3

Opencart is an E-Commerce platform with a great focus on usability and scalability!

• Last Updated: 01/09/2020
• ( minutes reading )

How to setup SEO friendly URLs in OpenCart 3

Introduction

URLs are one of the basic elements of SEO, yet they are essentially important and considered as a significant ranking factor. SEO friendly URLs are shorter versions of standard URLs that contain the keywords describing the content of a specific page. Therefore, SEO friendly URLs are not only beneficial for better indexing and search engine ranking, but they are also easily readable for your visitors. Here is an example for better understanding.

Standard URL:

http://hostarmadatutorials.com/index.php?route=information/information&information_id=4

SEO friendly URL:

http://hostarmadatutorials.com/about-us

In the following lines of this tutorial, we will guide you on how to set up SEO friendly URLs in your OpenCart 3 Online Store and get the most out of them for future SEO success.

 

Enabling SEO URLs

The first thing you will need to do is to enable the use of SEO URLs from the OpenCart backend. Please log in to your OpenCart Admin Dashboard and navigate through the left menu bar to System > Settings. Once you are there, please select the website to edit by clicking on the blue “Edit” button next to it.

 

Selecting the website to edit

 

When you access the “Setting” page, please switch to the “Server” tab. Look for the “Use SEO URLs” setting and make sure to tick the “Yes” checkbox. After you do that, please click on the blue “Save” button positioned at the upper-right corner of the page.

 

Enabling the use of SEO URLs

 

Now that you have successfully enabled the use of SEO URLs in your store, you are ready to continue to the next step.

 

Editing the .htaccess file

In order to fully enable the use of SEO friendly URLs, you will need to make sure the required Rewrite Rules are included in the “.htaccess” file. In OpenCart 3 they are included by default in the “.htaccess.txt” file located under the root directory of the application. In order to make the file functional, you will need to simply rename it to “.htaccess”. In other words, just remove the “.txt” suffix. Before you do that, you will need to delete the default “.htaccess” files (located in the same directory), as either way you will not be allowed to rename the file in question.

You can do that either via your favorite FTP Client or directly through the “File Manager” integrated into your cPanel account. For the purpose of this tutorial, we will be using the “File Manager”.

 

Renaming the .htaccess file

 

If you already have your own “.htaccess” file with certain rules configured, you can simply copy/paste the following lines in it:

 

# 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.xml$ index.php?route=extension/feed/google_sitemap [L]

RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]

RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

 

When this is done, the SEO URLs should be successfully enabled on your OpenCart Online Store.

 

Managing SEO URLs

Now that the SEO URLs are enabled in your store, you would probably want to customize them and configure your own keywords. You can manage them by navigating through the left menu bar to Design > SEO URL.

 

Accessing the SEO URL page

 

On this page, you will find the list of all your SEO URL entries. You will be able to create new ones and edit or delete existing ones by clicking on the corresponding “Add New”, “Deleted” (upper-right corner) and “Edit” (next to each entry) buttons.

 

SEO URL page overview

 

Now, please click on the “Edit” button for whichever entry you prefer and let’s review what information they contain. In our example, we will review the first “about-us” one.

 

Editing SEO URL

 

  • Query - The query identifies and represents the actual page you are editing in the default OpenCart installation.
  • Keyword - This is the actual slug (the part after your domain name in the URL) which will be used in the URL for this page. Note that the keyword must NOT contain spaces, wherever necessary, please make sure to replace them with hyphens (-).
  • Store - Determines the store in case it is an OpenCart Multistore installation. In our case it is not, therefore we have only the “Default” option.
  • Language - Determines the language of the store in case multiple languages are available.

When you are ready, please do not forget to click on the “Save” button in order to record the changes you have made.

 

Congratulations! You have just managed to make your URLs SEO friendly and improve your users’ experience. We hope you have found the information provided in this tutorial useful and our instructions easy to follow. In case you have any additional questions you are welcome to contact our Support Team.



...
Sebahat
Content Marketing Specialist

Sebahat is a young and bright woman who has become an invaluable part of our team. She started as a Customer Care Representative, mastering that role and, along the way, growing into a tech-savvy individual who is well acquainted with every support layer of the company. Driven by her aim to improve our customers’ experience constantly, she is committed to enhancing the extraordinary support we deliver.