php - Codeigniter invalid link opens as a valid link
Get the solution ↓↓↓I tried building a news section page on my codeigniter project. i have my class 'admin' and a function 'articles', normally the valid url is localhost/admin/articles but when i visit localhost/admin/articles/anything it still opens the articles page.
Below is the code for articles
<?php
class Admin extends CI_Controller {
public function articles() {
$data['volume'] = $this->user_model->get_volume();
$data['issue'] = $this->user_model->get_issue();
$data['article'] = $this->user_model->get_articles();
$data['title'] = "Admin Panel - Articles";
$this->parser->parse('admin/head',$data);
$this->parser->parse('admin/articles',$data);
}
}
my route.php
$route['default_controller'] = 'home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
.htacess
RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
The normal url is localhost/admin/articles, but adding anything after articles, e.g localhost/admin/articles/hello/world , still opens the articles page.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: your lock file does not contain a compatible set of packages. please run composer update
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.