Search code examples
smarty

Smarty : How to delete part of url?


I'm displaying current url with : https://mywebsite.com/{$smarty.server.SCRIPT_URL} So i obtain : https://mywebsite.com/shop1/mycategory/myproduct/ or https://mywebsite.com/shop2/mycategory/myproduct/ depending on the shop i'm connected on.

I need to delete the /shop1 or /shop2 in the url

How to do that ? Any idea ?

Thank you !


Solution

  • https://mywebsite.com/{$smarty.server.SCRIPT_URL|replace:'shop1/':''|replace:'shop2/':''}