When switching to any other page, the error falls out: Sorry,
Routes:
Route::get('/about', function(){ return view('about'); }); Route::get('/posts', 'PostController@index'); In the welcome.blade.php file - the main page
<div class="title mb-md"> Napotest </div> <div class="links"> <a href="{{ url('/about') }}">О нас</a> <a href="https://laracasts.com">Войти или зарегистрироваться</a> <a href="{{ url('/posts') }}">Список статей</a> <a href="https://forge.laravel.com">Список пользователей</a> </div> PostController.php
public function index() { $posts = $this->model->all(); return view('post.all', compact('posts')); } .htaccess
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] </IfModule> Virtual Host Settings
##<VirtualHost *:80> ##ServerAdmin webmaster@dummy-host.example.com ##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com" ##ServerName dummy-host.example.com ##ServerAlias www.dummy-host.example.com ##ErrorLog "logs/dummy-host.example.com-error.log" ##CustomLog "logs/dummy-host.example.com-access.log" common ##</VirtualHost> ##<VirtualHost *:80> ##ServerAdmin webmaster@dummy-host2.example.com ##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com" ##ServerName dummy-host2.example.com ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common ##</VirtualHost> Routs
Physically, these two pages exist about.blade.php and all.blade.php. Why does an error always appear ??
Interestingly, if the line browser to write: http: //localhost/Projects/mysite/public/index.php/about - the page opens!
