Search code examples
joomlacomponentsurl-rewritingsef

joomla rename component url using htaccess


I'm building an eshop using Joomla 2.5 and a commercial component for a guy who wants to have multiple vendros and I'm stuck on how to change the component's url.

What I want to change is the url that is displayed when the users passes from a link with his mouse.

For instance, the component has a SEF function which rewrites urls and makes them like that:

  1. http://www.site.com/componentname/products/productname-productid-productcategoryid-vendorid.html
  2. http://www.site.com/componentname/catalog/categoryname-categoryid-numberofpage.html

and what I want is to make it:

  1. http://www.site.com/shop/products/productname-productid-productcategoryid-vendorid.html
  2. http://www.site.com/shop/catalog/categoryname-categoryid-numberofpage.html

So when a user passes over a link it will show him the new url. Is this possible with .htaccess and rewrite rules or this can only be done through the component only? I'm asking this as the component is encoded with ioncube so I can't do it myself.

Thanks in advance!


Solution

  • While you can use .htaccess to rewrite any URL it won't work with Joomla! as the SEF URL is created by JRoute which uses a combination of the core route function and the route.php for the component.

    The URL segments are used to find the right component to handle the request, so to change the way the URL is built you would have to modify the route.php of the component (and obviously other parts as well).

    For more information on how SEF support works, read this on docs.joomla.org