0

I'm new to joomla and this isn't my field. I'm developing a module which should be shown on a page.

The URL which prints the content is info-compagnie-aeree.html?iata=af and I want it to be compagnie-aeree/af/foo-bar so I wrote the above rule in .htaccess

RewriteRule ^compagnie-aeree/?([A-Z0-9]+).* /orariovoli/index.php?option=com_content&id=498&view=article&iata=$1 [L]

where id=498 is the ID of the article in which my module is situated

In this manner it points to the right page (content of my module is shown) but the rest of page content is not shown...I suppose it is because I point to the article which contains in which my module is situated with {loadposition myModulePosition}

In short words I want to show the content of the page at http://webpartner.it/orariovoli/info-compagnie-aeree.html?iata=D9 but with this kind of URL http://webpartner.it/orariovoli/compagnie-aeree/D9

For reference, the URL I would like to have points here

Update: I think the understandable question is "where can I find the non-rewritten URL of a page?"

2

Might be worth expanding your question to cover a bit about what your module is actually doing, as I suspect this may come down to a misunderstanding of the difference between modules and components.

Using htaccess to structure URLs is taking things outside the Joomla framework. Component routers should be doing this job.

Using URL parameters in a module suggests to me that the design of your module is fundamentally wrong and you should be using categories or the menu manager to structure your content instead.

Modules don't have routers, so I can't imagine a sitution where what you are doing is good practice. Modules should really just be elements that are assigned per menu item.

If your URL design needs to be fundamentally different to how com_content's router works, that suggests to me that a bespoke component would be in order.

(Not an answer, I'm afraid - but this was a bit long to post as a comment.)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.