Object not found when clicking on hyperlink

Asked

Viewed 369 times

1

Hello, I am learning IC and I came across the following problem. By clicking a link in a home test, I would like to be transferred to another page and use another controller, but by clicking, I get this error:

Objeto não encontrado!

A URL requisitada não foi encontrada neste servidor. 
O link na página referida parece estar com algum erro ou desatualizado. .
Por favor informe o autor desta página sobre o erro.

This is my home.php

class Home extends CI_Controller {

    function __construct(){
        parent::__construct();
    }

    public function index(){
        $this->load->view('pages/home/index');
    }
}

And this is my views/pages/home/index.php :

<a href = "<?php echo site_url('application/controllers/ong'); ?>" class="btn btn-link">Ong</a>

htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

1 answer

0

The error you are seeing is provided by Apache when the URL you are trying to access does not exist within the web server. Most likely you haven’t typed the right URL.

See if this works: instead just access localhost (or 127.0.0.1), access the URL with localhost/*DIR*/home, where *DIR* is the name of the directory where the application was placed on the web server (for example, to C:\xampp\htdocs\proj_exemplo\ would be localhost/proj_exemplo/home) . Or, in the case of .htaccess be incorrect, try to access localhost/*DIR*/index.php/home/index, to try to force the location.

  • Opa, I was able to access from the /index.php/Ong, funny that I had already configured to not need index.php/. I’ll find a way to fix it, thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.