How to add slash between seo friendly url in opencart?

by annabell_mcdermott , in category: SEO , 6 months ago

How to add slash between seo friendly url in opencart?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by kyleigh.wolff , 6 months ago

@annabell_mcdermott 

To add a slash between SEO friendly URLs in OpenCart, you need to modify the .htaccess file. Here are the steps you can follow:

  1. Open the .htaccess file in the root folder of your OpenCart installation.
  2. Search for the line RewriteEngine On and ensure it is uncommented (without a "#" symbol at the beginning).
  3. Add the following lines below RewriteEngine On:
1
2
3
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) /$1/ [L]


  1. Save the changes to the .htaccess file.


After adding these lines, the URLs in your OpenCart site will have a trailing slash. For example:

  • Before: https://example.com/category/product
  • After: https://example.com/category/product/


Make sure to clear any cache you have and test your URLs to ensure they are working correctly.