不要在laravel5.3的项目中使用管理面板和授权

时间:2017-02-24 10:19:40

标签: php laravel laravel-5

我在laravel 5.3上制作管理员面板。我尝试安装sleepowl 4.我根据官方文档制作的所有项目。所有项目按预期运行(http://blog.laravel/)。但是......如果我去链接

 http://blog.laravel/admin

比apache问题:

 Not Found

 The requested URL /admin was not found on this server.

我尝试使用授权后。我创建了一个名为“auth”的新项目。但是......如果我去链接:

 http://auth/signup 

apache问题......:

 Not Found

 The requested URL /signup was not found on this server.

所有权利都可以写入重写。根据官方文件我的所有步骤:

 https://laravel.com/docs/5.3/installation

我不知道我做错了什么。请告诉我我该怎么办

有github的链接:

 https://github.com/AlexBukreyev/blog.laravel  - this is my project, where I make admin-panel.

 https://github.com/AlexBukreyev/auth  -  this is project of authorization

 file public /.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]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

2 个答案:

答案 0 :(得分:1)

确保在public目录中,有一个名为.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]

   # Handle Authorization Header
   RewriteCond %{HTTP:Authorization} .
   RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

答案 1 :(得分:0)

原来,它是在Apache的设置中!您需要通过控制台连接mod_rewrite:

  apache2ctl -M | grep -i rew
  sudo a2enmod rewrite
  sudo /etc/init.d/apache2 restart