I've been exploring codeigniter for quite some time now and so far it's been good. however I am really having a hard time figuring out how base_url works here. Take for example this one $config['base_url'] = 'http://Office-Inventory/';. If I run that as http://Office-Inventory/ it will give me error 404
Not Found The requested URL was not found on this server. Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 Server at dict-inventory Port 80
with this url http://office-inventory/login.
This really confuses me because if I use http://localhost:8000/, the project is actually working and i can access all controllers thru base_url or site_url.
I've been exploring codeigniter for quite some time now and so far it's been good. however I am really having a hard time figuring out how base_url works here. Take for example this one $config['base_url'] = 'http://Office-Inventory/';. If I run that as http://Office-Inventory/ it will give me error 404
Not Found The requested URL was not found on this server. Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 Server at dict-inventory Port 80
with this url http://office-inventory/login.
This really confuses me because if I use http://localhost:8000/, the project is actually working and i can access all controllers thru base_url or site_url.
Share asked Mar 30 at 16:03 Vic Zoren AbucotVic Zoren Abucot 1 2 |1 Answer
Reset to default 0Check your .htaccess
file or create it if it doesn't exist. It should contain the following code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Save it to your _codeigniter/
folder.
http://office-inventory/login
is potentially a completely different question (eg maybe you have nologin
route/method/view). – Don't Panic Commented Mar 30 at 20:51