EllisLab text mark
Advanced Search
     
Weird routing problem
Posted: 05 October 2012 10:38 AM   [ Ignore ]
Avatar
Joined: 2012-02-24
53 posts

I have default controller Site with functions for every page which loads view elements.

Using routes I’ve made URIs shorter, so: http://radenko.kosic.org/en/site/music is now: http://radenko.kosic.org/en/music.

Routes.php

// URI like '/en/about' -> use default controller
$route['^de/(about|web|photo|blog|music|contact|home|impressum)$''site/$1';
$route['^en/(about|web|photo|blog|music|contact|home|impressum)$''site/$1';
$route['^hr/(about|web|photo|blog|music|contact|home|impressum)$''site/$1';

// URI like '/en/about' -> use controller 'about'
$route['^de/(.+)$''$1';
$route['^en/(.+)$''$1';
$route['^hr/(.+)$''$1';
 
// '/en' and '/de' URIs -> use default controller
$route['^de$'$route['default_controller'];
$route['^en$'$route['default_controller'];
$route['^hr$'$route['default_controller']

It works fine, but I have problem to redirect http://radenko.kosic.org/music (it shows 404).

I’ve tried things like this:

$route['music''en/$1'

and

$route['about|web|photo|blog|music|contact|home|impressum''en/$1'

but it shows 404 error when opening pages like: http://radenko.kosic.org/music.
This is my .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteCond 
$!^(index\.php|public|images|robots\.txt|style)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule