Welcome Guest, Not a member yet? Register   Sign In
Routes and hashed URLs
#3

Personally I use this .htaccess for CI:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(index\.php|resources|vendor|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

resources = images, css, js...
vendor = boostrap, jquery...

You can remap your URL with URI Routing.

application/config/routes.php
PHP Code:
$route['default_controller'] = 'dashboard';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

$route['(:any)'] = 'dashboard/index/$1'

application/controllers/Dashboard.php (case sensitive)
PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Dashboard extends CI_Controller
{
 
   public function index($id '')
    {
        echo 
$id;
 
   }


@InsiteFX: I thinks this is more like uniqueness like e.g. pastebin or regex101 does.
Reply


Messages In This Thread
Routes and hashed URLs - by wirikidor - 11-21-2017, 05:11 PM
RE: Routes and hashed URLs - by InsiteFX - 11-22-2017, 04:32 AM
RE: Routes and hashed URLs - by wirikidor - 11-22-2017, 08:18 AM
RE: Routes and hashed URLs - by Narf - 11-22-2017, 09:23 AM
RE: Routes and hashed URLs - by wirikidor - 11-22-2017, 09:59 AM
RE: Routes and hashed URLs - by jreklund - 11-22-2017, 05:24 AM
RE: Routes and hashed URLs - by wirikidor - 11-23-2017, 04:02 PM
RE: Routes and hashed URLs - by Narf - 11-22-2017, 11:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB