-1

我正在尝试在 ubuntu 服务器 14.04 LTS 上删除 lumen 5.2 上的公共路径

这是我的 .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On 
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

我已经在我的 apache 上允许mod_rewrite

还将此添加到我的 apache2.conf 以允许覆盖

<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.

但是,如果我添加了publicurl 的路径,它就可以工作。有人遇到这个问题吗?

我正在尝试将网址 http://www.example.com/public设为http://www.example.com/

4

2 回答 2

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>

重启阿帕奇。

于 2016-04-08T11:20:57.500 回答
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

于 2016-04-08T10:43:01.980 回答