0

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.

2
  • 1
    have you read Supporting SEF URLs in your component ? Commented Mar 29, 2013 at 15:18
  • Yes, Thanks but I read and made the changes but if only after enabling the menu item for the link it works and without menu item the same thing is repeating. Commented Mar 30, 2013 at 4:55

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, you are right. but is there any possibilities to make this as my requirement in .htaccess also
You could do rewrite rules in your .htaccess. But creating menu items (or using a SEF component) is surely the better way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.