Ram
Ram

Reputation: 387

rewrite url in codeigniter

My codeigniter website current url is www.websitename.com/fronend/deals/index/all/all. (note:frontend is folder inside controller, and deals is controller)

I wants to change it to www.websitename.com/deals/ using htaccess. I had tried some code but not able to do that.Is that possible to change it using htaccess.

Previously, I had removed the index.php from the url of my codeigniter site using following htaccess code.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

this is working fine.So I think, I needs to add some rewrite rule for this.

could u pls explain me how to do this.Thanks

Upvotes: 0

Views: 97

Answers (1)

max
max

Reputation: 3736

you don't need htaccess

in

.\application\config\routs.php

add

$route['deals'] = "fronend/deals/index/all/all";

Upvotes: 3

Related Questions