skip to Main Content

Im using an ajax (live-search) by vqmod.
I have enabled my SEO and product links works well. But when i click on a product via the search function its taking me to the old link which is:


My current SEO links looks like this


I’ve searched in the .XML file for the Vqmod and I found this code and maybe its connecting to the old link.

select: function(event, ui) {
   location = 'index.php?route=product/product/&product_id='+ui.item.value;
   return false;

Is there anyway to change it or modify it? Maybe redirect from .htaccess?



  1. You can check with following .htaccess code.

    Options +FollowSymlinks
    # Prevent Directoy listing 
    Options -Indexes
    # Prevent Direct Access to files
    <FilesMatch "(?i)((.tpl|.ini|.log|(?<!robots).txt))">
     Order deny,allow
     Deny from all
    # SEO URL Settings
    RewriteEngine On
    # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/  
    RewriteBase /yourshopfolder/
    RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
    RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
    RewriteRule ^system/download/(.*) /index.php?route=error/not_found [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

    Create you own htaccess file on root folder and put above code on that. It will work.

    I have checked it in open-cart version +

    Login or Signup to reply.
  2. The possible ways to handle this would be (in order of decreasing desirableness):

    1. return the seo url with the ajax results
    2. do a second ajax request to get the seo url
    3. redirect once the product page is loaded

    In all those scenarios you’ll want to use the core Opencart url class like this:

    $url = $this->url->link('product/product', 'product_id=' . $product_id);
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top