Search code examples
phpcodeignitercodeigniter-2codeigniter-urlcodeigniter-routing

Remove Controller & function name from url using codeigniter


I want to remove controller and function name from my url. my url looks like

example.com/config/addRoom.aspx

where "config" controller name & "addRoom" function/method name. I am using htaccess for remove index.php. and I configure my routes.php file like this

    $route['room'] = "config/addRoom";

but it's not working. pages are not found plz help


Solution

  • Please Write "room" at the place from where you want the redirection .. like now you are writing

    in Controller :- redirect("config/addRoom") ;

    Make It Redirect("room");

    Or In View :- now you are write like href="config/addRoom"

    Please Make it

    href="room"