Welcome Guest, Not a member yet? Register   Sign In
Weird routing problem
#1

[eluser]Altazar[/eluser]
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
Code:
// 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:

Code:
$route['music'] = 'en/$1';
and
Code:
$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:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|images|robots\.txt|style)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>




Theme © iAndrew 2016 - Forum software by © MyBB