Firstly i am new to codeigniter i did follow the steps of the docs and some yt videos but I can't seem to get codeigniter to work properly here is my issue
1. My SetUp
Server: Xampp :: localhost
My folder htdocs/crm/code files here
I changed my xampp 'httpd.conf' from
DocumentRoot "C:/xampp/htdocs/"
<Directory "C:/xampp/htdocs/">
to
DocumentRoot "C:/xampp/htdocs/crm/public/"
<Directory "C:/xampp/htdocs/crm/public/">
so that i can access codeigniter via http://localhost/ rather than http://localhost/crm/public
and i changed app\Config\App.php base url etc....
when I go to localhost/ it shows me the codeigniter welcome screen same with localhost/index.php but when i try to type localhost/home it says ->
404 - File Not Found
Can't find a route for 'get: home'.
but home is a controller in my folder app\Controllers\Home.php
home.php
<?php
namespace App\Controllers;
class Home extends BaseController
{
public function index()
{
return view('welcome_message');
}
}
It should be accessible via the url right? can anyone tell me what i might have done wrong? did i not configure something correctly.
Please understand i am new to codeignter not php but just the framework its my first time using it and if i need to supply more info or docs please comment and i will edit my Q
Thank you and have a great day :)
yourdomain/index.php/controllername. Then it may work. The reason is simple, MVC frameworks start every request with index.php file.