I have a controller to display some data and my yii install is in a folder named api.
If i navigate to localhost/api/mycontroller I get a 404 error.
But if I put my yii install in my root folder and navigate to localhost/mycontroller it works.
Any tips what am i doing wrong?
Thanks
Try to add index.php on the path and see it works or not.
e.g localhost/index.php/api/mycontroller
If it works, you can hide 'index.php' follow the guide below.
http://www.yiiframework.com/wiki/214/url-hide-index-php/
Related
For testing purpose I have Installed fresh Laravel-7 and also installed joedixon/laravel-translation package, all are working fine.
After that I have changed root directory and others (I have to change for implementing the Translation in another running project which root directory like that)-
Change things are-
Moved index.php into root directory, ex: myproject/public/index.php to myproject/index.php
Move .htaccess into root directory
In index.php, changed-
require __ DIR __.'/vendor/autoload.php';
and
$app = require_once __ DIR __.'/bootstrap/app.php';
And for Translation I added the /public/ for the path of css, js in resources/views/vendor/translation/layout.blade.php
And now all are working but when I try to update the translation file, It throws an error showing the requested url is not found.
Everything else seems to work fine expect for updating the translations.
How to solve ?
Screenshot attached.
enter image description here
i didnt work with this package before but i have noticied a double slash // in your requested url you trying to post to ( in the screenshot ) so that could cause a 404 since there is difference between
http://localhost/cartpro_language_test//languages/bn
and
http://localhost/cartpro_language_test/languages/bn
make sure its accesible in your routes check php artisan route:list
by default its accessible under /languages not /cartpro_language_test/languages so verify if there is any other changes you made that cause the url to be different than the one sat up
i did the exact same modifications and its working for me
Hello everyone i am new to laravel and i hope someone can help me about my problem. I created a laravel project. After that I import it to cpanel using softaculous. Then, I made some changes base on what i research in the net to avoid showing important file like .env . I created a folder relative to public_html, let say the folder name is 'tamangbilang' where i put almost all of my code except the index.php. Inside my public_html folder, I have another folder named as 'tamangbilang' where my index.php resides. I have followed this instruction https://dev.to/pushpak1300/deploying-laravel7-app-on-shared-hosting-hostinger-31cj the only difference is that I put another folder inside public_html.I also did some changes on the index.php code
require __DIR__.'/../../tamangbilang/vendor/autoload.php';
$app = require_once __DIR__.'/../../tamangbilang/bootstrap/app.php';
Everything is working fine on my login page(my first page) but when I try to login, an error occur.
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
It seems like the connection between routes was lost. I did further testing and I notice that the code is working well only if there is an index.php, before the route in the url. example
http://my-sample-domain.org/tamangbilang/index.php/login
P.S. I don't have access for ssh.
go to bootstrap folder & open cache folder then delete config. after that please check your routes this error basically arises due to routes not found for that go to your project installed on local and write php artisan route: list check if the route is present or not.
I created my new project in Symfony 3.4.* and but not using the build-in webserver. I am using a shared Hosting with runs on Nginx. I change the root .../public_html to root .../public_html/web which includes the app.php etc. I am now able to visit domain/app.php which shows that Symfony is running. But if i change the DefaultController route from "/" to "/home" its not working for some reason. It says "File not found."
Whats going wrong exactly? I did try to create an symbolic link from /web to ../public_html but this did not work.
Please assist.
Take a look at this, from the Nginx site.
https://www.nginx.com/resources/wiki/start/topics/recipes/symfony/
You shoud modify that according to your needs.
i have php project with ci framework. then i install laravel valet. I access my admin page using this domain myprojectname.dev/admin. but the admin page return is 404Page Not found. can somebody help me to fix this ?
If You using codeigniters routing, then You should write like: myprojectname.dev/index.php/admin, if You hav not `.htaccess file in Your root folder
I started studying CodeIgniter Web Framework and I am trying to work with PHPStorm 8.0.3 on Kubuntu 14.04. When I unzip CodeIgniter downloaded archive to root Apache folder /var/www/html and go to
localhost/index.php
then it works okay and I see "Welcome to CodeIgniter!" page. Also I
can use
localhost/index.php/welcome/index
and see the same page as it should be.
When I created a new PHP project in PHPStorm and try
localhost:63342/codeignitor/index.php/
then I see welcome page, but if I use
localhost:63342/codeignitor/index.php/welcome/index
then I get 404 page. Also all my own controllers are not available and
cause 404.
I can call my own controller only if I make it default
$route['default_controller'] = 'mycontroller';
I think that this problem occurs because the URL contains name of my project /codeignitor/, but I'm not sure about it. So I need your advice how to set CodeIgniter environment in PHPStorm correctly to solve this problem. Thank you!
Codeigniter uses the URL to determine routing, therefore /codeigniter/index.php/welcome/index and /index.php/welcome/index are not equal paths. I would recommend using one or the other, and adjusting your /index.php and /config/routes.php to accommodate for your desired path.
References:
Codeigniter Subfolder
https://www.codeigniter.com/user_guide/general/urls.html
https://www.codeigniter.com/user_guide/general/routing.html
https://www.codeigniter.com/user_guide/general/environments.html