Advertisement:

Author Topic: How to get category url from item url if item is deleted?  (Read 788 times)

Syed

  • Full Member
  • ***
  • Posts: 232
How to get category url from item url if item is deleted?
« on: August 12, 2017, 05:10:36 pm »

I want to redirect my visitors coming from google search, to the search page and want to show him related items if intended item is no longer available.
Regards.


marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1492
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: How to get category url from item url if item is deleted?
« Reply #1 on: August 12, 2017, 09:03:40 pm »
I think you could try with htaccess but I'm not shure what's the exact code you should use.
If you have permalinks enabled, a typical link to an item is:

http://yoursite.com/category/category/../item_ixxx

So you must eliminate de code "/item_ixxx"
So you must eliminate the code after the last "/" by redirecting the url ending with i152 for example to the same url but without the part after the last slash "/".

BUT only if if that item is not found.
« Last Edit: August 12, 2017, 09:06:40 pm by marius-ciclistu »

Syed

  • Full Member
  • ***
  • Posts: 232
Re: How to get category url from item url if item is deleted?
« Reply #2 on: August 16, 2017, 09:38:10 am »
Thank you marius-ciclistu,

I want to know if there exists any function in osclass to identify Item Url?

Regards

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1492
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"

Syed

  • Full Member
  • ***
  • Posts: 232
Re: How to get category url from item url if item is deleted?
« Reply #4 on: October 14, 2017, 08:33:44 pm »
Still waiting for solution.

Regards

mrtsoftware

  • Sr. Member
  • ****
  • Posts: 343
Re: How to get category url from item url if item is deleted?
« Reply #5 on: January 25, 2018, 01:29:21 pm »
Nobody can help about this?

If visitor click deleted item, should be diverted to category where item published inside...

By the way, I am seeking someone who can help me for some modifications ( I pay )

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1492
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"