Welcome Guest, Not a member yet? Register   Sign In
Urgent! Web made with CI is not being displayed in mobile devices
#4

[eluser]luismartin[/eluser]
Hello Aken and Wan. Thanks for your quick replies.

Aken: I didn't implement myself anything to prevent the web from being displayed in mobile devices, as long as there is anything I must specifically do in CI to allow them to work.

Wan: The following are the CI routes, and next the .htaccess rewrite rules:

Code:
$route['default_controller'] = 'home';
$route['404_override'] = 'error_404';

// Pagination routing in backend
$route['admin/(series|productos|acabados|articulos|usuarios)/([0-9]+)'] = 'admin/$1/index/$2';

$route['((\w{2}/)?)ideas-and-trends'] = 'ideastrends';
$route['((\w{2}/)?)ideas-and-trends/(.*)'] = 'ideastrends/index/$3';

$route['((\w{2}/)?)serie/(.*)'] = 'serie/index/$3';
$route['((\w{2}/)?)producto/relacionados/(.*)'] = 'producto/relacionados/$3';
$route['((\w{2}/)?)producto/(especificaciones|instrucciones|relacionados|descargas|descargar)/(.*)'] = 'producto/$3/$4';
$route['((\w{2}/)?)producto/(.*)'] = 'producto/index/$3';
$route['((\w{2}/)?)catalogos/(.*)'] = 'catalogos/index/$3';
$route['((\w{2}/)?)proyectos-realizados/(.*)'] = 'proyectosrealizados/index/$3';
$route['((\w{2}/)?)ideastrends/(.*)'] = 'ideastrends/index/$3';
$route['((\w{2}/)?)contract-m2o/(.*)'] = 'm2o/index/$3';
$route['((\w{2}/)?)innovacion/(.*)'] = 'innovacion/index/$3';
$route['((\w{2}/)?)buscar/(.*)'] = 'buscar/index/$3';

// These more generic rules go next so that they dont interfere with routes like "proyectos-realizados"
$route['(\w{2})/([a-zA-Z0-9_]*)-(.*)'] = '$2$3'; // Removes controller dash for a route with language
$route['([a-zA-Z0-9_]*)-(.*)'] = '$1$2'; // Removes controller dash
$route['(admin/[a-zA-Z0-9_]*)-(.*)'] = '$1$2'; // Removes controller dash in backend

$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller'];

Code:
<IfModule mod_rewrite.c>
RewriteEngine on

RewriteRule ^(es|en|fr|de|it|ru|us)/(css|js|images|assets|scripts|ckeditor|robots.txt)(.*) $2$3  [L]
RewriteRule ^(es|en|fr|de|it|ru|us)/(.*) $2?lang=$1 [L]

RewriteCond $1 !^(index.php|css|js|images|assets|scripts|ckeditor|robots.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

I know the routes file is kind of messy and it could be done with fewer lines, but I will tidy it up as soon as possible.


Messages In This Thread
Urgent! Web made with CI is not being displayed in mobile devices - by El Forum - 03-06-2012, 04:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB