URL Rewriting |
[eluser]applegh[/eluser]
Hi everybody, I recently implemented multi language on my website and am trying now to have nice and clean urls but without success... I have two variables to select the page displayed and the language of the page, so i can access my pages through urls like: Code: http://www.apple-guesthouse-sihanoukville.com/index.php/pages/view/en/home But I would like to have urls like ***.com/en/home I tried the following .htaccess file: Code: DirectoryIndex index.php This file is working but i want to keep my clean url (and not use a external redirection), but when i switch the [R] flag to [L] (or [P] or nothing) i get a 404 error. Here is a few extracts from my other files: Controller/pages.php Code: $this->load->helper('url'); Config/routes.php Code: $route['default_controller'] = '/pages/view'; Any idea how to fix my htaccess? Can i just remove the "index.php/pages/view" from my urls with CodeIgniter or do I absolutely have to use the .htaccess? Thanks for your help!
[eluser]weboap[/eluser]
index.php : i can understand why its there in the url read this to take it off http://ellislab.com/forums/viewthread/217541/ but this part : "/pages/view/" how come? what is your file structure? and this ?? Code: require("decide-lang.php");
[eluser]applegh[/eluser]
Thanks i changed my htaccess as described in your post: Code: DirectoryIndex index.php And change my route.php Code: $route['default_controller'] = '/pages/view'; And it works! Thanks a lot
[eluser]applegh[/eluser]
Just one more thing. I access my pages through urls like www.monsite.com/en/home or www.monsite.com/fr/room I want to access my pages through: en.monsite.com/home fr.monsite.com/rooms My htaccess was: Code: DirectoryIndex index.php I tried sevral things but cannot manage to make it work... Any idea? |
Welcome Guest, Not a member yet? Register Sign In |