Yes, you can.
Typically, CI creates a url like this base_url / controller_name / method name.
As you know, the name of the controller and the name of the method cannot contain '-' (hyphen), so you cannot change their name.
What you can do is use a router to display the correct controller with the appropriate URL.
How can you write this code in config / routes.php
$route['get-artist-discography/artist-name'] ='get_artist_discography/artist_name';
This will execute your controller get_artist_discography and artist_name if your link is http://localhost:8888/ci/index.php/get-artist-discography/artist-name
You can learn more about URI routing in CI docs.
source share