How to enable Search Engine Friendly URLs

Updated on Dec 10, 2015

By default OpenCart does not generate Search Engine Friendly URLs for your store. In this tutorial we will show you how to enable SEF URLs for your OpenCart website.

mod_rewrite

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

This can be easily activated via your OpenCart Admin dashboard by referring to the System → Settings menu via the main navigation and click on Edit link next to your store name.

OpenCart Settings

On the new page, please click on the Server tab from the sub navigation.

OpenCart Server Settings

On the Server settings tab you will need to find the Use SEO URLs option and set the radio button to Yes. Save your settings via the Save button on the top right corner of your screen.

OpenCart SEO URLs

Be advised that after activating the SEO URLs for your OpenCart store you will need to perform one additional final step to complete the activation. Access your hosting account via your favorite FTP client or using your cPanel → FileManager and navigate to your OpenCart installation directory. If you have installed your application under the root of your domain name (ex: http://example.com) usually this is your public_html directory.

In the OpenCart installation directory you should locate a file called .htaccess.txt. Please rename the file from

.htaccess.txt to: .htaccess (note the 'dot' prefix of the filename)

In case you cannot locate the .htaccess.txt file under your account, please create a new .htaccess file on your local computer with the following content and upload it under your OpenCart directory:

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]
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]

In case your OpenCart is installed under a subdirectory, please change the following line in the code above:

RewriteBase / - > RewriteBase /your-folder/

Save your file and make sure it is properly uploaded under your OpenCart directory. Now you should have your Search Engine Friendly URLs activated.

On this page...

    OpenCart Hosting

    • Free Installation
    • 24/7 OpenCart Support
    • Free Domain Transfer
    • Hack-free Protection
    • Fast SSD Storage
    • Free OpenCart Themes
    • Free OpenCart Transfer
    • Free CloudFlare CDN
    View More