As opencart uses the SEO url, but I found most of the programmers are not using it in localhost, so today I am showing how to enable url redirect in OpenCart in localhost. To use SEO URLâ€™s, 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 favourite text editor. In XAMPP, this file is found in the apacheconf directory (or /lampp/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