How To Make SEO Friendly URL In Opencart

In this tutorial, we are going to learn howto make SEO friendly url in OpenCart. A lot of folks out there are facing issues with Opencart SEO urls, so today I have written a post for you. Lets jump in 🙂

Step 1 : Rename your OpenCart .htaccess.txt file

“.htaccess.txt” file is named as “.htaccess.txt” by default for servers that might not support .htaccess file, or for those who simply don’t wish to activate it.

You need to activate your .htaccess.txt file. To do this, you simply have to remove the “.txt” file extension from the file name, so it will be “.htaccess” only.

Once done, you are one step done to your Opencart SEO friendly URLs.

Step 2 : For stores installed in a subdirectory

If your Opencart store is installed in a sub-directory, you will need to take few extra steps to make SEO friendly url in Opencart. Otherwise your opencart .htaccess file wont be able to re-write the urls correctly.

If your store is installed on the root directory, please ignore this step.

Okay, now you are following this step because your Opencart store is installed in a sub directory, for example www.mystore.com/store 

  • Open .htaccess file in a text editor (e.g. notepad, or any other)
  • Find this section in your .htaccess file:

 

# 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=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]

 

The only thing we need to edit is the “RewriteBase” section, so it will look like this:

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

RewriteBase /store/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]

Make sure to put “/” at the end of the sub directory name, otherwise Opencart SEO friendly urls will not work properly.

Once done, proceed to final step 🙂

 

Step 3: Changing Settings To Make Opencart SEO Friendly Urls

 This is fairly easy step, to do so:

  • Login to your Opencart administration
  • Go to System->Settings->Edit->Click the “Server” Tab
  • See for “Use SEO URL’s”, simply turn that to Yes.

 

opencart-seo-friendly-urls

You are all good to use Opencart seo friendly urls.

Make sure to edit each product, category, information pages, etc and fill the “SEO Keyword” section (you will find it in “Data” tab of your product).

If you are still getting 404 errors at this point then get in touch with your Web Host and ensure that they have mod_rewrite installed on the server and you are able to use it with your hosting package.

Please feel free to ask if you have any question 🙂

 

 

 

 

 

Share

The founder of Design Tempest, Hamza Ghani is an eCommerce developer specialising in OpenCart development and Small Business Web Design, Hamza has worked with hundreds of businesses and runs his own company Xperteria which offers Web Design for small businesses, eCommerce Development, Internet Marketing and more. You can find him on and Twitter