Post by AaronAdkins » Wed Aug 17, 2016 4:56 pm

Hi,

I have recently made a new build of a website using opencart. All 301 redirects from the old site are working fine in the .htaccess file.

I now need to disable some of the products on the store, however, I don't want the "product not found" page to be shown & I can't seem to get these pages to redirect to the category page.

For example, I would like www.example.co.uk/category/sub-cat/product-1/ to be redirected to www.example.co.uk/category/sub-cat/ but can't figure out why this isn't redirecting. I thought this could be due to a caching issue but it appears not.

Any help is greatly appreciated. Thank you.

Newbie

Posts

Joined
Wed Aug 17, 2016 4:51 pm

Post by webecho » Mon Jan 23, 2017 4:58 pm

Did you find a solution for this?

New member

Posts

Joined
Mon Dec 06, 2010 9:17 am

Post by thekrotek » Tue Jan 24, 2017 12:56 pm

You can simply replace 'error/not_found' in product controller with 'catalog/category'. Should work.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by EvolveWebHosting » Wed Jan 25, 2017 7:39 am

thekrotek wrote:You can simply replace 'error/not_found' in product controller with 'catalog/category'. Should work.
This is not a good idea.

Instead, create a 301 redirect in your .htaccess file

2 Week FREE Trial of our Shared Hosting plans (DIrectAdmin or cPanel) for new customers
2 Week FREE Trial of Astra Firewall and Malware Scanner
Visit our website for full details and to start your trial today - www.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by Johnathan » Wed Jan 25, 2017 11:46 pm

You could do this with Redirect Manager, but you'd need to do it for each URL you want to redirect. If you want something that automatically does it, you'll need a small modification to do that. I actually have this on my list for future extension ideas, but need to finish up a few other projects first.

If you need it immediately, you can probably hire a developer to do this mod for you for not too much. If you need to find a developer, you should post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by thekrotek » Thu Jan 26, 2017 6:00 am

EvolveWebHosting wrote:This is not a good idea.

Instead, create a 301 redirect in your .htaccess file
Of course it's not. Why have two-lines VQMod, when you can have a bunch of rules for every disabled product in .htaccess? Let alone the perfect opportunity to edit .htaccess again, when disabled product becomes available! Mmm...

In this particular controller visitor is redirected to 'error/not_found' page exactly, when product is not found (disabled). There's absolutely no reason to have an extension to do such simple task. Either edit file directly or create a VQMod, which will inject one super simple replacement.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 49 guests