How to Format SEO URL with Slashes in Magento Last Updated on 4 August 20254 August 2025 Mark Mac Magento Table of Contents Toggle TASK: Adding slashes into SEO URL in MagentoSOLUTIONS TASK: Adding slashes into SEO URL in Magento From: https://www.example.com/products?p=1&attributes=value To: https://www.example.com/products/p/1/attributes/value SOLUTIONS You can override the getUrl() method in the class Mage_Catalog_Model_Layer_Filter_Item, path /app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php Then, locate the function at line 57, it will look like this: public function getUrl() { $query = array( $this->getFilter()->getRequestVar()=>$this->getValue(), Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls); return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query)); } In file config.xml of your custom module, rewrite class Mage_Catalog_Model_Layer_Filter_Item: <models> .... <catalog> <layer_filter_item>Namespace_Module_Model_Catalog_Layer_Filter_Item</layer_filter_item> <catalog> .... </models> Overriding function getUrl() of class Mage_Catalog_Model_Layer_Filter_Item in class Namespace_Module_Model_Catalog_Layer_Filter_ItemExample with category: public function getUrl() { if($this->getFilter()->getRequestVar() == "cat"){ // or �color’, �price’,... $category_url = Mage::getModel('catalog/category')->load($this->getValue())->getUrl(); $return = $category_url; $request = Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true)); if(strpos($request,'?') !== false ){ $query_string = substr($request,strpos($request,'?')); } else{ $query_string = ''; } if(!empty($query_string)){ $return .= $query_string; } return $return; } else{ $query = array( $this->getFilter()->getRequestVar()=>$this->getValue(), Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls ); return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query)); } } We have shown you some simple steps in order to add slashes into the SEO URL in Magento. If you have any problems when following this Magento tutorial, be free to leave a comment below. See you in the next tutorials! Mark Mac Mark Mac is our adept Project Lead at Tigren. A skilled problem solver and expert developer, Mark's leadership in web/app projects is evident through his strategic thinking and technical prowess. Committed to propelling businesses forward in the dynamic tech landscape, Mark ensures excellence in every endeavor. Share Table of Contents Toggle TASK: Adding slashes into SEO URL in MagentoSOLUTIONS