我正在使用Laravel5.1和一个PuPHPet虚拟机,使用Apache (所以不是Homestead)。
我的公共dir中有默认的.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]
</IfModule>我去过apache2.conf;
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all granted
</FilesMatch>
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>我重新启动了apache2;
sudo service apache2 restart但我还是找不到;
http://192.168.56.131/auth/register
但不是继续;
http://192.168.56.131/public/auth/register
所以我不知道现在该做什么。它的一部分必须工作,因为不再需要index.php。
* UPDATE *
这是可行的;
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]但事实并非如此;
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]只是不喜欢“公开”这件事。
这是我的apache2.conf文件的更新部分;
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>真令人沮丧!我不明白我在这里错过了什么。
发布于 2015-08-18 22:40:19
Apache配置应该在vhost配置文件中,而不是htaccess中。
PuPHPet使用php,mod_php支持几个月前就放弃了.
发布于 2015-08-18 22:49:31
试一试
RewriteEngine On
RewriteRule ^(.*)$ /public/$1 [L]https://stackoverflow.com/questions/32048894
复制相似问题