1

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 :

http://tageto.pnf-sites.info/developer/headcategory_controller/head_category/Agriculture

than it must be replaced into

http://tageto.pnf-sites.info/developer/Agriculture

and if i have url like this

http://tageto.pnf-sites.info/developer/headcategory_controller/sub_category/Rice

than it must be replaced into

http://tageto.pnf-sites.info/developer/Rice

and if i have url like this

http://tageto.pnf-sites.info/developer/products/view_product/nokia-internet-stick-cs-17-hsdpa-144mbps-logo-nokia-black-1

than it must be replaced into

http://tageto.pnf-sites.info/developer/nokia-internet-stick-cs-17-hsdpa-144mbps-logo-nokia-black-1

Can anybody solve my this issue? Please reply rapidly.

.htaccess

 <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.

2

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',
);
2
  • 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 '13 at 7:57
  • i try it but user controller not working. show error is 404 url not found – rahul Mar 20 '18 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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