SEO URL’s activated for OpenCart at localhost

Make url redirect in opencart at localhost
Make url redirect in opencart at localhost

As opencart uses the SEO URL but we found most of the programmers are not using it in localhost, so today we are showing how to enable URL redirect in OpenCart in localhost. To use SEO URLs, the apache module mod-rewrite must be installed and you need to rename the htaccess.txt to .htaccess.

Enabling .htaccess in Xampp

Open the httpd.conf file with your favorite text editor. In XAMPP, this file is found in the apache/conf directory (or /LAMP/etc in Linux)

Locate the following line of code:

#LoadModule rewrite_module modules/mod_rewrite.so

Remove the # from the line as seen below to enable the module:

LoadModule rewrite_module modules/mod_rewrite.so

Save the Httpd.conf file

Restart your Apache Server

Now in the opencart admin activate SEO URL from

Admin>>System >> Setting >> Edit your store >>then at Server tab >> Enabled the SEO URL.

After that rename the .htaccess.txt to .htaccess

Now if your SEO URL does not work then find RewriteBase / / in .htaccess file and add folder name between slashes.

For eg: if your folder name inside the Htdocs is YOURSTORENAME then it will be

RewriteBase / YOURSTORENAME /

Make url redirect in opencart at localhost
Make URL redirect in opencart at localhost

Then save and you will be able to work with the SEO URLs in localhost

We hope this opencart tutorial helps you understand the affiliate flow of Opencart 3. Let us know if you have any questions or suggestions, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Twitter and Facebook.

4 COMMENTS

  1. Dear webocreation team,

    How can Enable SEO URLs activate for OpenCart at cPanel?

    I am trying to activate SEO on my website but it shows me the error below

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at webmaster@….com to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    • Hi Abdul,
      500 error means a server error.
      Check with the webserver if the mod_rewrite is enabled in the server.
      Please confirm which webserver you are using, most popular for Opencart are Apache and Nginx.
      Once you know which web server you are using then you can configure it.
      For e.g. if Apache server then you can just rename the .htaccess.txt to .htaccess which is available in the Opencart default codebase. Or you can use the following code to add in the .htaccess:

      Options +FollowSymlinks
      Options -Indexes

      Require all denied

      RewriteEngine On
      RewriteBase /
      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|webp|js|css|svg)
      RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

      Note: Be sure that your hosting provider allows the change in the .htaccess as some cheap hosting provider does not allow it.

      You can check this posts as well
      Opencart error and fixes

LEAVE A REPLY

Please enter your comment!
Please enter your name here