G
G
GaserV2016-09-27 14:01:58
Laravel
GaserV, 2016-09-27 14:01:58

Why does it say page not found?

Tell. The situation is the following. Installed laravel. Everything opens at the url www/public/. I wanted to remove public from url. Found a solution with htaccess:

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]

Now I open www/ and I get an error. "Sorry, the page you are looking for could not be found. NotFoundHttpException in RouteCollection.php line 161:"
How to edit, please tell me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sts, 2016-09-27
@stunoff

virtual host make yourself and norms

<VirtualHost *:80>
  DocumentRoot "C:/xampp/htdocs/laravel/public"
  ServerName laravel.dev
  ServerAlias www.laravel.dev
  <Directory "c:/xampp/htdocs/laravel/public">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

just don't forget to add to hosts
127.0.0.1		laravel.dev
127.0.0.1		www.laravel.dev

A
Alex Wells, 2016-09-28
@Alex_Wells

There is no such solution that it would be possible to download a site from a repo in two seconds and it worked. You will always need to raise and configure the server, and often the same thing is repeated, and nothing can be done about it. stunoff's answer is correct. You NEED to use virtual hosts, that's the point. Another option is to use .htaccess, but this is not quite the right solution, rather a temporary one. It is difficult to explain why, but it is necessary. It's the same way you set a password on MySQL even though it's only available locally. It is better to have extra security measures than to rely on one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question