I have the following component @
?option=com_tmportal&module=user&task=main
I’ve enabled url rewriting and setup the htaccess file which is all working correctly, how would I create a rewrite rule that allows me to access the component above by simply doing:
/portal/ = ?option=com_tmportal
or
/portal/user = ?option=com_tmportal&module=user
or
/portal/user/main = ?option=com_tmportal&module=user&task=main
Thanks for any help, much appreciated 🙂
You haven’t specified Joomla version so I’m assuming 1.6/7/2.5 in my answer.
Short Answer: If you’re using Joomla!’s default .htaccess then all you have to do is create a Joomla! menu to each of your components views with the right alias eg.
portalfor your default component access ie.?option=com_tmportal.This is what the default
.htaccessdoes it passes all of the elements after the base URL toindex.phpto help select the component and view.Longer Answer
When you create a component for Joomla! you specify the menu settings for each view using an XML file usual the same name as the view file in it’s
view/tmpl/directory.Typically the url to a specific view & task in a component would look like these:
Joomla!’s framework will automatically use the
view&taskparams to get your components correct controller and view (or sub-view). I’m not sure that it does anything with themoduleparam that you have in your URL’s so I’d guess you’re trapping and processing that yourself.