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 /
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.