S
S
Sujimoshi2016-11-15 19:09:53
Apache HTTP Server
Sujimoshi, 2016-11-15 19:09:53

Redirect to index.php not working in Laravel 5 project?

So. We have the following:
.htaccess:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

httpd-vhost.conf:
UseCanonicalName Off

<VirtualHost *:80>
    ServerName dev
    ServerAlias *.dev
    VirtualDocumentRoot /Volumes/HDD/Sites/%1
</VirtualHost>

<VirtualHost *:80>
    ServerAlias *.lar
    VirtualDocumentRoot "/Volumes/HDD/Sites/%1/public"
</VirtualHost>

laravel routes:
Route::get('/', function () {
    return view('welcome');
});

Route::get('/home', function () {
    return 'some';
});

/etc/hosts:
127.0.0.1 mysite.lar
Everything seems to be correct. When I go to mysite.lar/ everything works (I see the welcome page). But when I go to mysite.lar/home I get an internal server error. In the apache logs, it writes the following:
[Tue Nov 15 17:57:50 2016] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
As I understand it, the maximum number of redirects has been reached. But why do they happen I do not understand?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question