[SOLVED] Mod_rewrite issues with i18n internationalization |
[eluser]du7ch[/eluser]
I'm building a bilangual (english - french) site using the i18n internationalization supplied in CodeIgniter's GitHub page. This allows the language (en/fr) to be included in the URI before the controller. Everything works fine when I leave the index.php in the URI. www.mydomain.com/index.php/welcome gets routed properly to www.mydomain.com/index.php/en/welcome However, when I try to hide index.php using the htaccess file it doesn't seem to work. I get a 404 error if I input either: www.mydomain.com , www.mydomain.com/en , www.mydomain.com/en/welcome . The url appears correctly (www.mydomain.com/en/welcome) but CodeIgniter doesn't seems to handle the parameters well. Here are my file configurations (the config is relative to MAMP running on my local machine and CodeIgniter is running in a subfolder named ci). config.php Code: $config['base_url'] = 'http://localhost:8888/ci/'; routes.php Code: $route['default_controller'] = "welcome"; MY_Lang.php This file is included with i18n internationalization module Code: var $languages = array( .htaccess Code: RewriteEngine On I don't believe I'm missing anything in terms of configuration. If anyone could help out it would be greatly appreciated. Thanks.
[eluser]NeoArc[/eluser]
Umm, there are some issues with MAMP, try this.. http://ellislab.com/forums/viewthread/178186/#844583
[eluser]du7ch[/eluser]
Ok, so I thought that the suggestions in the other thread were going to help as the index.php was causing my issue. My .htaccess file now looks like this Code: Options -Indexes However, I'm still getting a 404 error when entering something like localhost:8888/ci/en/welcome I took a look at the Apache logs and this is what I have Code: [Mon Aug 27 10:47:59 2012] [error] [client ::1] File does not exist: /Applications/MAMP/htdocs/ci/en, referer: http://localhost:8888/ci/ /en seems to be being handled like a folder or a controller and not like the language. I never had this problem when I wasn't trying to hide index.php
[eluser]NeoArc[/eluser]
Perhaps the .htaccess files are disabled by default in the apache .conf file <VirtualHost *:80> #..... #..... <Directory /sites/momentum> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
[eluser]du7ch[/eluser]
Everything seems to be ok Code: <Directory "/Applications/MAMP/htdocs"> I think the problem is within the library itself, because I have another site in a different sub-folder in my htdocs folder and the rewrite rules are being applied correctly there. Has anyone else experienced this with the Internationalization library?
[eluser]du7ch[/eluser]
I figured it out. I'm really kicking myself in the butt for this. The rewrite rules were all in the .htaccess file that was within the application folder. I simply copied the file into the root (in my case the ci folder one level above the application folder) and everything is now working perfectly. |
Welcome Guest, Not a member yet? Register Sign In |