I have made a basic Laravel project and had configured my api.php file to have a GET route when I want to fetch data for my project, but whenever I try to load the data on browser or perform a GET on the link (localhost:8000/data) from postman, it shows Error 404 Not Found. It seems that the GET is not able to find the URL that I had mentioned above. How can I get this issue sorted?
Not 100% sure this applies to you from the question. But Laravel prepends /api/ to API routes by default.
Maybe try requesting from localhost:8000/api/data?
Related
I want to create a template for page not found. whenever 404 no route found exception is throwing need to redirect to page. As that is not in proper UI way. I tried steps from this URL
https://symfony.com/doc/current/controller/error_pages.html
I am new to symfony . followed steps until service.yml and created customExceptionController.php and I dont know what to do next step and I am getting error like
How to fix this issue.Please anyone help me to get out of this issue. Thanks in advance
In the dev environment, you will always see the default exception page which is meant to ease debugging issues. If you want to see how a certain error page looks like in the prod environment (because you maybe created a custom template for it), you need to access a special URL that is only available for this purpose in the dev enviromnent (see https://symfony.com/doc/current/controller/error_pages.html#testing-error-pages-during-development). In your case, this URL is http://127.0.0.1:8000/_error/404
i have installed laravel in wamp...here is my routes.php code ..
Route::get('/',array('uses'=>'DirController#ShowLogin'));
above code works fine by displaying login page but the below code does not work...
Route::get('login',array('uses'=>'DirController#ShowLogin'));
i get an error message public/login was not found on this server. anyway to fix this???
There is something wrong with your .htaccess file. All requests should be directed to public/index.php
You may want to look at the documentation: http://laravel.com/docs/installation#pretty-urls
I have an issue making my cakephp project work on my shared hosting server.
I followed all the needed steps so it can work on local, and it's working. Once I upload on the server, in a specific domain name, only the homepage works, once I want to call another controller, i get the "404 - File or directory not found." error.
the project is hosted at : fme.tahrijouti.com. the domain redirects to the webroot folder in the cakephp structure.
My controller is : posts. I can make it work if I change the URL by specifying the controller & action, you can see it here.
I have checked and the rewrite module is on.
Can you please help me with that ?
Please have a look on CakePHP default routing. And don't forget to fix all your links.
Your links should have proper addresses. Just look on your Posts's link. These are like this http://fme.tahrijouti.com/index.php/posts/posts/view/2 but it should be http://fme.tahrijouti.com/index.php/posts/view/2. Remember after your host name there exist controller then a function of that controller then argument of that function like this: [host]/[controller]/[function]/[argument1]/[argument2]. Hope it helps. I think you can read cookbook another bit as most things are clear there from my experience.
As I don't have your codes of controller I cannot say more.
I just recently got a project based on CodeIgniter and I am total beginner.
I have added new view in my CI views and I want to load it to popup window when I press on a given link. But I get that my playerview.php page is forbidden on this server error 403. So where should I edit or change settings so that I have permission to use my new view?
The .htaccess file has only one line and it says
Deny from all
You can't call a view directly from a browser. Views are loaded by controllers, and controllers are called based the URL. It is typically www.yoursite.com/controllername/functionname
If you read the general topics section of the CI docs, it will all make sense.
I finally got a basic framework set up and working, however now when I wish to add an action in the 'IndexController.php', it doesn't seem to be working.
I used the following terminal command to add an "about" action:
zf create action about index
It appears that worked, as I opened 'IndexController.php' back up and the new action function is there. And a corresponding 'about.phtml' file was created in 'views/scripts/index', alongside 'index.phtml' that was already there.
When I access the index at
http://localhost3:8888/
the page opens properly.
However if I now try to access the about page at
http://localhost3:8888/index/about
I get a "404 not found" error.
Any ideas?
Looks like a mod_rewrite problem.
Try http://localhost3:8888/index.php/index/about. If it works, then it definitely means that mod_rewrite wasn't correctly set up.