【发布时间】:2018-08-14 15:29:27
【问题描述】:
在 Windows 10 上安装了带有 Vagrant 的 Laravel,由于某种原因,所有 laravel 路由都不是基于: 流浪者(Ubuntu 16 + Apache2):
在 Vagrant File 上取消注释这些行:
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder "www", "/var/www/"
Apache 000-default.conf
<VirtualHost *:80>
ServerAdmin info@somesite.devs
ServerName somesite.devs
ServerAlias www.somesite.devs
DocumentRoot /var/www/somesite/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /phpmyadmin /usr/share/phpmyadmin/
<Directory /usr/share/phpmyadmin/>
Options FollowSymlinks
DirectoryIndex index.php
</Directory>
/etc/hosts:
127.0.0.1 localhost
127.0.1.1 ubuntu
192.168.33.10 somesite.devs
C:\Windows\System32\drivers\etc\hosts:
192.168.33.10 www.somesite.devs
C:\www\somesite\public.htaccess :
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
【问题讨论】: