0

I am developing multilanguage website using codeigniter. It is required to locate language at the beginning of the base url. what should I write in route.php, in of view, and so on, so to have the final result to look like the following:

lang.mysite.com 

lang must be changed all times the language is changed Thanks a lot in advance.

2 Answers 2

1

as far as i understand from your question: it's not good to add language at the first of domain because browser deal with this language as sub domain, the best way to make url as the following www.somewebsite.com/en/controllerName/functionName and this things will be done in codeigniter easily : read this please https://github.com/bcit-ci/CodeIgniter/wiki/URI-Language-Identifier thanks :)

Sign up to request clarification or add additional context in comments.

Comments

0

you can do it dynamically on your routes.php.

Like:-

require_once( BASEPATH .'database/DB'. EXT ); $db =& DB(); $query = $db->get( 'routes_urls' ); $result = $query->result(); foreach( $result as $row ){ $route[$row->item_converted_url] = $row->item_url; } 

routes_urls are saved into db

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.