durai durai - 9 months ago 52
PHP Question

How to remove controller name in URL of codeigniter and need to add menu and submenu as URL name

I need to remove controller name from URL of code igniter
For ex

www.example.com/welcome/about us
Www.example.com/welcome/our services

I need URL as

www.example.com/about us
Www.example.com/our services

Then also i need to have sub menu for our services that URL shoild look like

Www.example.com/welcome/our services/service1
Www.example.com/welcome/our services/service2

How to achieve this routing in code igniter

Answer Source

if you ONLY want to remove 'welcome' from the URL,

you could do:

$route['(:any)'] = "welcome/$1"