• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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>


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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