CodeIgniter Forums
Routing problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Routing problem (/showthread.php?tid=33148)



Routing problem - El Forum - 08-17-2010

[eluser]Unknown[/eluser]
Hello,

Routing problem:

Routes.php:
Code:
$route['krems/(.*)/(.*)'] = 'krems/search/$1/$2';
$route['ru/krems/(.*)/(.*)'] = 'ru/krems/search/$1/$2';

Htaccess
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Route .../krems/xx/xx - working just fine
Route .../ru/krems/xx/xx - not working

tried diferent ways, no success...


Routing problem - El Forum - 08-17-2010

[eluser]Clooner[/eluser]
[quote author="[GS]" date="1282055294"]Hello,

Routing problem:

Routes.php:
Code:
$route['krems/(.*)/(.*)'] = 'krems/search/$1/$2';
$route['ru/krems/(.*)/(.*)'] = 'ru/krems/search/$1/$2';

Htaccess
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Route .../krems/xx/xx - working just fine
Route .../ru/krems/xx/xx - not working

tried diferent ways, no success...[/quote]

What error does it give? Your routes seems fine. Also strange that the one does work and the other not.

As I can see from your route setup you have 2 controllers with the same name with one of them in the subdirectory RU. This seems odd to me and more logically that you mean:
Code:
$route['krems/(.*)/(.*)'] = 'krems/search/$1/$2';
$route['ru/krems/(.*)/(.*)'] = 'krems/search/$1/$2';

otherwise there might be an error with the krems controller in the ru directory.


Routing problem - El Forum - 08-17-2010

[eluser]Unknown[/eluser]
Error 404

No /ru/ is langege prefix.
http://codeigniter.com/wiki/URI_Language_Identifier

Workign:
Code:
../ru/krems/search/
../krems/search/
../krems/

Not working
Code:
../ru/krems/