在Windows 10上安装了带有Vagrant的Laravel,并且由于某些原因,所有laravel路由都不基于: 流浪者(Ubuntu 16 + Apache2):
取消注释流浪文件中的这些行:
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]
答案 0 :(得分:0)
Mod_rewrite不允许执行其工作,因此您无法访问任何使用漂亮网址的网址。您只能进入索引。
您丢失了(或类似的东西):
AllowOverride All
在主机配置中查找相关目录。
尽管您似乎希望为此站点使用单独的虚拟主机。