简体   繁体   中英

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

you don't need htaccess

in

.\application\config\routs.php

add

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM