I am working on SEF - router.php to make my site url user friendly. This is my url and I want to remove the name 'component' and 'com_test' from this url.
http://localhost/projects/component/com_test/project/1-unique.html
I have checked with unset($query['view'])
but it doesn't make any changes on the site.
Note : Please dont got for creating menu item for aliases.
You need menu items for that. otherwise you will get exactly these URLs. There is no way to avoid the /component/com_test/
part as Joomla is not able to guess what you want to do. The part behind that (/project/1-unqiue
) is up to the router.php of your component.
If you don't want to have a menu item visible on your site, you can also create hidden menu items just for SEF purposes. You create a new menu with those menu items in it, but don't assign it to a module or just don't show the assigned module on any page.