Welcome Guest, Not a member yet? Register   Sign In
Display controller on homepage
#1

[eluser]Unknown[/eluser]
I am running the script for a bilingual site. Everything runs well, I even have a language switcher. The only problem I'm having is that on my homepage (domain.com/en) when I switch the language it links to (domain.com/en/fr). This works on all the other pages with controllers in the URI but my homepage doesn't have a controller in the URI. How do I go about having the homepage controller displayed in the URI? I need domain.com/en/home.
#2

[eluser]smilie[/eluser]
Hi,

You 'must' have controller for home page, it is defined in config/routes.php

Most probably you have:

function index() {} in that controller, meaning:

domain.com/yourdefaultcontroller.php/index will work as well :-)

By the way, why don't you switch from domain.com/en simply to domain.com/fr (with redirect or such)?

Cheers,
Smilie
#3

[eluser]Unknown[/eluser]
Because I am using the script in this forum for multilingual websites. I wasn't really sure how to do it. I'm happy with the URI I have, I just need the controller on the homepage to be in the URI. It works on all other pages so there must be somewhere I can change this. All my controllers are pretty much identical.
#4

[eluser]smilie[/eluser]
Well, that is what I am saying Smile

Controller on the homepage _is_ working, it is just not visible in the URL (because of your htaccess rewrite). If you do not have controller on the home page, then it would not work.

So, when user changes language - just send him to the domain.com/fr and it should be ok.

Cheers,
Smilie




Theme © iAndrew 2016 - Forum software by © MyBB