php - Laravel basic routing returns 404 -
I have recently started learning Laravel but there is a problem which I do not know why this happens. My current Laravel project is located on
wamp / www / codebright . When I reach localhost / codebright / public> , then see my welcome page. When I create a simple routing:
Root :: find ('my / page', function () {return "harrow world";}); and attempt to use: localhost / codebrights / public / my / page it returns with error 404, even with Laravel error also no. I have also tried to use: localhost / codebright / my / page and still. However, if I type cmd php artisan serve and open a server on 8000 port and then log in: localhost: 8000 / my / page It works just fine. I want to know why my first method is not working without the commander command. Thanks in advance!
Note
It seems that if you have XMP installed, then there is no one in the above mentioned problems and the comment comment section. In fact, if you are using XAMPP, you will not get the most errors and the program will work properly. It is possible to do exactly what you want to do, but if you do artisan service
, you must have the webserver installed correctly. Clearly a webserver has been installed from your original post, as you get the welcome page, but it looks like one of the following: - You have
.htaccess place the file - Your base on your web server setup is vhost (or if apache configuration is not using any vhost)
allow override all (which That <<> .htaccess files to work) - You have
mod_rewrite f Lu is not You should see them. At least, Laravel has a need to turn on the URI, which does not exist as the real files ( my / page>), which can make a duplicate for such a page . It requires the use of mod_rewrite and a .htaccess file to specify too many rules.
Interpretation of the difference between using Apache Artisan Service : Artisan service does not use 'Dunga' webserver as Apache And in turn, uses a webserver which can be controlled by the 'non-existent' URIs which you browse, so you should see the mod_rewrite and .htaccess File is not needed.
Comments
Post a Comment