I am working in netbeans
I've controller named Cms with a function signup in which I load the view as
$this -> load -> view('cms/signup');
and view is on the followoing location
D:\xampp\htdocs\CMS\application\views\cms
in the routes.php I've defined the following route to access this view
$route['aaa'] = 'cms/signup';
when I type the following URL http://roz.com/cms/aaa it says CI error message "page not found" yesterday it was working. default controller is working fine without index.php with following URL 'http://roz.com/cms'
please advice where the problem lies actually. I am working on localhost
Related
My code igniter project is returning 404 whenever I use method that I created in controllers. I have it running on Mac OS Mojave on Apache2.
There might be configuration or setting that I missed.
The codeigniter page works fine when opening http://localhost/myproject where I see the welcome page.
I have a 404 problem when I start using the new controller class. To make it simple, I created below "Pages.php" controller file inside application/controllers folder:
<?php
class Pages extends CI_Controller {
public function view()
{
echo "running the view method";
}
}
I expected the page to display "running the view method"
but the result is a 404 page at http://localhost/myproject/view or http://localhost/myproject/index.php/view.
it works by adding below in route.php
$route['(:any)'] = 'pages/$1';
When I got an error in laravel site then i have received this error page.I want to redirect to another page which I have created custom looks like a valid error page.
enter image description here
enter image description here
First in your .env file (in your project's root) set false for app_debug ->
APP_DEBUG=false
Then create a file named 500.blade.php that contains your custom html css in (resources\views\errors)
Done.
(for others errors like 404 , 503 , just change the name of file to that error code)
More information Here
In Laravel 5.2 docs about Implicit route model binding, there is written:
If a matching model instance is not found in the database, a 404 HTTP
response will be automatically generated.
Route:
Route::get('/product/{product}',function(Product $product){
dd($product);
});
When I enter into URL parameter existent ID, everything works as expected. But when I enter into URL nonexistent product ID, I got No query results for model [App\Product]. instead of response 404. Any ideas why?
After searching i found out solution. If you have no specified error template files in resources/views/errors default Laravel message will be shown. Just create 404.blade.php file in resources/views/errors.
I'm using Laravel 4.2 framework for my website, and want it catch my 404 error correctly. My problem is that the server return a different 404 page when I try to open some bad link inside the public folder. Please give me some advice, thank you very much.
Folder structure:
-- app
-- bootstrap
-- public
--assets
--packagespage
-- vender
Normally, I set my 404 page like this:
When I tried http://localhost:8000/assets/some-name and http://localhost:8000/packages/some-name => new 404 page here:
When I type an invalid url (non-existent controller), it displays the homepage rather than return a 404 Page Not Found page. Does anyone know the possible reason?
Thanks
Have checked if there is any plugins are registered in the bootstrap and if is it configured to catch the exceptions or set any ACL mechanisms.
Also check the error controller too. may be there is some forwarding methods implemented there.
Hi i've had the same problem and i now know how to fix it:
within the bootstrap have the following init
function _initModules()
{
$this->bootstrap('frontController') ;
$front = $this->getResource('frontController') ;
$front->addModuleDirectory(APPLICATION_PATH . "/modules");
$front->setParam("useDefaultControllerAlways", false);
}
Setting 'useDefault....' will use the default controller when a 404 occurs.
You should also make sure your error controller is setup correctly