Routing in laravel3 does not work properly

I am a new bee in Laravel. I created Laravel using this tutorial . I installed a virtual host, on my virtual host I wrote this.

<VirtualHost *:80> ServerName ranjitalaravel.com DocumentRoot "/var/www/html/laravel4/public" <Directory "/var/www/html/laravel4/public"> </Directory> </VirtualHost> 

In my host file ie / etc / hosts

 127.0.0.1 ranjitalaravel.com 

When I type http://ranjitalaravel.com/ in my browser, the entire list of files inside my laravel directory is displayed. But when I type the house after it, it shows me: "The requested URL / house was not found on this server." I wrote this code in the route.php file inside the application folder.

 Route::any('home', function() { return View::make('home.index'); }); 
+4
source share
3 answers
 <VirtualHost *:80> ServerAdmin postmaster@some _server DocumentRoot "E:/xampp/htdocs/some_server" ServerName some_server ServerAlias some_server ErrorLog "logs/some_server.localhost-error.log" CustomLog "logs/some_server.localhost-access.log" combined </VirtualHost> 

this works great for me hopefully helps you

0
source

Try this configuration

 <VirtualHost *:80> ServerName ranjitalaravel.com DocumentRoot /var/www/html/laravel4/public <Directory /var/www/html/laravel4/public/> Options +Indexes +FollowSymLinks +MultiViews AllowOverride all Order allow,deny allow from all </Directory> </VirtualHost> 

Do you use symbolic links?

0
source

Instead of using VirtualHosts from time to time, why not use the PHP 5.4 embedded development server.

Here XAMPP localhost returns an object not found after installing Laravel

-1
source

Source: https://habr.com/ru/post/1488505/


All Articles