Some time ago I am working on a project that I developed in Codeigniter 3.x where I carry out the typical actions of CRUD, in addition to the call to JOBS in SQL Server.
When testing the service locally, it does not present any inconvenience, everything works super well, loads all .css and .js, correctly generates the address, and everything is great.
To do the addressing, I have done it using the helper ('url') which allows me to use base_url
Every call, whether CSS, js, or other pages, I have made with that helper.
So far so good ... The problem arises when I transfer my project to the server. When executed locally (on the server), it works without problems. But I need other users to connect to it and conduct their operations.
at the moment of entering from another computer to the address of that server the page loads, but without .css, nor .js, nor redirects ...
I put an example of how I'm calling each .css in the view:
<head>
<title>Finanzas</title>
<link rel="stylesheet" href="<?php echo base_url('assets/css/bootstrap.css'); ?>" />
<link rel="stylesheet" href="<?php echo base_url('assets/DataTables/DataTables-1.10.16/css/dataTables.bootstrap.min.css');?>"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css"> <!-- este funciona bien, pues no es con base_url -->
<link rel="shortcut icon" href="<?php echo base_url('imagenes/favicon.ico');?>" />
</head>
My base_url:
$config['base_url'] = 'servidor:4002/codeigniter/';
Naturally this code is only able to load the element that is being called without the base_url.
When viewing through the "view source code" of the browser, I click on the called element, and it does not open the .css immediately, I must copy the link, paste it in the browser and press enter.
Any ideas?
Thanks in advance for the time and help!