我正在尝试删除ubuntu服务器14.04 LTS上流明5.2的公共路径
这是我的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
我已经在我的apache上允许 mod_rewrite
还将此添加到我的apache2.conf以允许Overrides
<Directory /var/www/html/lumen>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
我收到了错误
Sorry, the page you are looking for could not be found.
但是如果我将public
路径添加到url就可以了。谁有这个麻烦?
我正在尝试制作网址
http://www.example.com/public
至http://www.example.com/
答案 0 :(得分:0)
更改
<Directory /var/www/html/lumen>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
要
<Directory /var/www/html/lumen/public>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
因为您的文档根目录是public
。并从public/
.htaccess
答案 1 :(得分:0)
解决此问题:
恢复原始.htaccess
,绝不编辑。
编辑你的Apache配置文件,你应该有这样的东西:
<VirtualHost *:80>
ServerName myapp.localhost.com
DocumentRoot "/var/www/html/lumen/public"
<Directory "/var/www/html/lumen/public">
AllowOverride all
</Directory>
</VirtualHost>
重启Apache。