Im trying enable seo_url in Opencart 2.3 on lockalhost(with Docker), but url's give me 404 error. .htaccess renamed, cache clear.
How it works on docker ?
THANKS !
Im trying enable seo_url in Opencart 2.3 on lockalhost(with Docker), but url's give me 404 error. .htaccess renamed, cache clear.
How it works on docker ?
THANKS !
Firs of all - take default .htaccess.txt file form your versions OpenCart pakage. If you made some changes in your .htaccess - it is better to take the original one. In other case - skip this step.
You have to rename .htaccess.txt into .htaccess. It's not so obvious on Windows. Open it with notepad and then Save As the file, renaming it to .htaccess without .txt
. Hope, you done this already, but for everyone else who will read this - make sure you have done it.
If your are using inner folder for your OpenCart site, and the address is like http://localhost/inner_folder/ - your rewrite base in .htaccess should be RewriteBase /inner_folder/. If the OC folder is domain root - rewrite base is RewriteBase /
Although, make sure that you are using Apache web server with modrewrite. Go to php error log - maybe you will find there some info.
Make sure the Use SEO URLs is Yes in System> Settings > your store > Server.
There is SEO URL field in every category, product, manufacturer. You should fill SEO URL field of each of them to SEO URL works correct. In SEO URL you should use only Latin symbols, digits, minus(-) and underscore (_). No spaces or other special characters.
UPDATED
If apache doesn't see .htaccess file - you should go to apache .conf file (/httpd/httpd.conf for Docker) and add after VirtualHost block
<Directory /var/www/html/your_folder/>
Options Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Directory - is a path from Docker root. Restart apache. Should work.