Forums

router

webcrea 18 Jan, 2019
Hi,

Do you know how to use a router for a connexion?

Simple exemple :

in db table 2 columns id,alias and i would want to make

url non-sef with an id routes to an alias
and
sef with an alias routes to an id

sh404 installed

Regards
Max_admin 18 Jan, 2019
Answer
1 Likes
Hi Christophe,

All urls are passed to the router function in Joomla, so just include the id and alias parameters in the url and it will be converted to SEF url automatically if there is a router for that.

Best regards,
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
webcrea 18 Jan, 2019
A link like this ?

admin/worldwide-calendar?conn=crmSessions&id=560&alias=sussex-wine-school-uk%2Fiws-unit1-eng-1-jan-feb-2019&providers_id=50&event=session&sessions_id=560

URL in the link is :
sessions_id={var:tb_events_details.row.sessions.id}&id={var:tb_events_details.row.sessions.id}&alias={var:tb_events_details.row.sessions.session_alias}

But nothing change in the url sef..??
healyhatman 29 Jan, 2019
What's the problem sorry? All of those will still be in the URL because they're URL parameters.
webcrea 30 Jan, 2019
hi,

in a view:link

I try to rewrite the url
admin/worldwide-calendar?conn=crmSessions&id=560&alias=sussex-wine-school-uk%2Fiws-unit1-eng-1-jan-feb-2019&providers_id=50&event=session&sessions_id=560

in
worldwide-calendar/560-sussex-wine-school-uk.html

regards
healyhatman 30 Jan, 2019
https://stackoverflow.com/questions/14786340/rewrite-url-with-htaccess-for-multiple-parameters
webcrea 30 Jan, 2019
Thanks Healty but if i understand Max, I have just to pass alias and id in the url and it will be rewrite by the rooter...
No need to change something in .htaccess...
healyhatman 30 Jan, 2019
Not without additional work, from what I understand.

All urls are passed to the router function in Joomla, so just include the id and alias parameters in the url and it will be converted to SEF url automatically if there is a router for that.

Max_admin 30 Jan, 2019
Hello,

Creating SEF url for a connection will not be possible because Connectivity does NOT have a router file, I thought you are building urls for com_content and that would work because com_content has a router.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
healyhatman 30 Jan, 2019
You can build your own router.php file, there are instructions on Google.
webcrea 31 Jan, 2019
Thanks you two.
I understand but how to use router only on one connexion?
So, i think build url in link with alias and export list in sh404.
But every new item need to be insert in sh404
What do you think about that?
healyhatman 31 Jan, 2019
You can create your own router.php , or you can create individual rules in SH404. Your choice.
webcrea 31 Jan, 2019
I understand but how to use router only on one connexion?
This topic is locked and no more replies can be posted.