Welcome Guest, Not a member yet? Register   Sign In
URI multilingual CodeIgniter
#1

[eluser]Unknown[/eluser]
We're using Codeingiter library i18n (http://jeromejaglale.com/doc/php/codeigniter_i18n) to create a multilingual site.

Before this, we had for example www.thedomain.com/register and register was a function in our controller. Now when we put this library it grabs the domain, the language string, the controller's name and the functions name: www.thedomain.com/es/homegf/register (where homegf is our controller).

We want this URI's to work without the name of our controller on it (www.thdomain.com/es/register) like in the librarie's examples but we think the problem is in our routes.php.

This is what we have in routes.php

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$route['default_controller'] = "homegf";
$route['404_override'] = '';
$route['^(en|es|de)/(.+)$'] = "$2";
$route['^(en|es|de)$'] = $route['default_controller'];

This is our .htaccess

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|files|robots\.txt)
RewriteRule ^(.*)$  /index.php/$1 [L]

You can find our code to review it at https://bitbucket.org/ticketcomunicacion...tilenguaje
#2

[eluser]kamikaz[/eluser]
How did you manage to only show the function name in the url?

What did you change in your htaccess after you installed i18n library?
#3

[eluser]Unknown[/eluser]
I've solved changin my routes.php to this:

Code:
$route['^es/(.+)$'] = "homegf/$1";
$route['^en/(.+)$'] = "homegf/$1";

$route['^es$'] = $route['default_controller'];
$route['^en$'] = $route['default_controller'];

$route['(:any)'] = 'homegf/$1';




Theme © iAndrew 2016 - Forum software by © MyBB