I’m having a controller named : main_controller
all the links in my app refers to it with url like : /main_controller/...
Now i want to insert some SEO in all this and change the url to a more seo one like /seo_name_for_controller/...
Instead of doing a full manual search & replace for all occurences which may be source of errors, I wish i could do this using htaccess with something like :
RewriteRule ^/main_controller/(.*)$ /seo_name_for_controller/$1 [L,R=301]
Then using routes.php to finish the process like :
$route['seo_name_for_controller/(:any)'] = "main_controller/$1";
Is it possible or will it cause an infinite loop ? does someone have a code example for this ?
It shouldn’t cause a problem. The CI Route is not technically redirecting, it is just using the URI pattern to call a specific controller. This should work.
Have you tried it to see what happens though? Your question suggests no trial.