Osclass forums

Support forums => Tips, tricks, and tutorials => Topic started by: Syed on August 12, 2017, 05:10:36 pm

Title: How to get category url from item url if item is deleted?
Post by: Syed 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.

Title: Re: How to get category url from item url if item is deleted?
Post by: marius-ciclistu 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.
Title: Re: How to get category url from item url if item is deleted?
Post by: Syed 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
Title: Re: How to get category url from item url if item is deleted?
Post by: marius-ciclistu on August 16, 2017, 03:13:39 pm
https://forums.osclass.org/development/get-item-url-by-item-id/
Title: Re: How to get category url from item url if item is deleted?
Post by: Syed on October 14, 2017, 08:33:44 pm
Still waiting for solution.

Regards
Title: Re: How to get category url from item url if item is deleted?
Post by: mrtsoftware 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 )
Title: Re: How to get category url from item url if item is deleted?
Post by: marius-ciclistu on January 25, 2018, 01:42:23 pm
I repeat https://forums.osclass.org/development/get-item-url-by-item-id/