Jump to content


404 Page not Found - index.php/examples - Codeigniter 4 - Grocery Crud v2.0.0-BETA


  • Please log in to reply
1 reply to this topic

#1 Andware

Andware

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 18 May 2020 - 09:16 AM

Hello

 

I am new on php and Codeigniter 4 with grocery-crud-codeigniter-4 and have not much knowledge om php or codeigniter yet.
I have installed which are described in Readme file but i recipient every time a message that site not found (404 Page not found)!

Jeg har installeret Codeigniter 3 med kĂžbmand 1.6.3 og der har jeg ikke nogen problemer.

Can you tell me what I'm doing wrong. Maybe it has something more Routes to do?

Here some more info:

<>404 - File Not Found    <p>
                        Controller method is not found: index                    </p>
</div>

 



#2 kilden

kilden

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 24 June 2020 - 06:52 PM

Hello, I've got the same issue. For me, it's seems to be a problem of base_url or routing with Ajax functions. But I don't succeed in fixing it.

 

- My app (Codeigniter-4) is set in a subfolder called 'myapp'.

- So I set the base_url in app/Config/App.php like this : public $baseURL = 'https://mydomain.local/myapp/';

- The same for the .env : app.baseURL = 'https://mydomain.local/myapp/

- In my header.php, I add the base in the <head> :

<head>  <base href="<? echo base_url(); ?>/" target="_self">

- and then a bootstrap menu with links like this :

<li><a class="nav-link" href="'.base_url().'/customers_management">customers</a></li>

- I've changed the routes like this to test the exemple of Grocery Crud (and rename the Controller "Crud"):

$routes->get('customers_management', 'Crud::customers_management');
$routes->get('customers_management/(:segment)/(:num)', 'Crud::customers_management/$1/$2', ['filter' => 'auth']);

I've bought and also installed bootstrap-4.

 

 

First, I see perfectly the table of customers... Even when I want to edit, I see one customer and I can cancel... But then :

All buttons (with Ajax) make issues :

 

- the green button "Update changes" indicates : "An error has occurred on saving."

- the blue button "Update and go back to list" indicates : "An error has occurred on saving."

 

My js console indicates :

Failed to load resource: the server responded with a status of 404 (Not Found)
https://mydomain.local/myapp/index.php/customers_management/update_validation/119

And indeed : there is an undesirable segment "index.php".

 

The button "add" and "export" makes the same problems and all the Ajax function...

https://mydomain.loc..._management/add

https://mydomain.loc...nagement/export

 

Should I make special routes for this ? Or can I fix this with a setting or modification in my code ?

 

huge thanks for any help !

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users