Routing problem

#1
[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...

#2
[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.

#3
[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/


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.