Loading


Advertisement:

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

Syed

  • Full Member
  • ***
  • Posts: 149
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: 808
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: 149
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


Syed

  • Full Member
  • ***
  • Posts: 149
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