in htaccess or route.php where from you want you can give answer for this issue.

I Need some thing like this.if i have url :


than it must be replaced into


and if i have url like this


than it must be replaced into


and if i have url like this


than it must be replaced into


Can anybody solve my this issue? Please reply rapidly.


 <IfModule mod_rewrite.c>

RewriteEngine On

    # Removes index.php from ExpressionEngine URLs
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
  #  RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteRule ^(.*)$ index.php/$1 [L] To remove index.php i need all i mentioned above for url so that url becomes canonical.

1 Answer 1


Template Routes

Control your URLs by remapping URI routes to a specific template, using CodeIgniter-style routing rules.

$config['template_routes'] = array(
    'blog/:category' => 'site/blog-category',
    'blog/:year/:pagination' => 'site/blog-yearly-archive',
    'blog/:any' => 'site/blog-single',
  • Sir i already using it [$route['headcategory/(:any)'] = 'headcategory_controller/headcategory/$1'; $route['subcategory/(:any)/(:any)'] = 'headcategory_controller/subcategory/$1/$2';] . But i want to remove [subcategory] and [headcategory] before it
    – user2387
    Nov 21, 2013 at 7:57
  • i try it but user controller not working. show error is 404 url not found
    – rahul
    Mar 20, 2018 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.