Hello, first of all I apologize for my bad English.
I am having a problem with the routes and if there will be no problem, I would like to explain by giving examples. I will give the example from a completely clean and fresh install. So there is no additional development etc.
There is a line in the "welcome_message.php" page that calls a style file from the "public" folder.
This line is:
Code:
<link rel = "stylesheet" href = "assets/css/style.css">
If I call the route as follows, the style.css file loads without problems and looks like this (
example.com/assets/css/style.css)
PHP Code:
$routes-> get('welcome', 'Home::index');
But if I call the route as a group that I mentioned below, the style.css file is not loaded and the path looks like this (
example.com/blog/assets/css/style.css)
PHP Code:
$routes->group('blog', function ($routes) {
$routes->add('welcome', 'Home::index');
});
I follow such a way to avoid using base_url when calling entities. If I add "base_url ()" to the beginning of the line I call this css file, there is no problem and it calls the file in both ways without any problem, but I wanted to get your feedback because it was interesting to me. Is this a normal process? So is this what it should be or I'm making my mistake somewhere. And I wonder if there is a way to solve this without adding base_url ?
Thank you very much for your help in advance.