laravel the requested url was not found on this server

前端 未结 9 861
不思量自难忘°
不思量自难忘° 2020-12-12 12:54

I\'ve an Ubuntu 14.04 kernel. I was installing my Laravel application in this server. After installing, I tried to set the root directory to public.

sudo n         


        
相关标签:
9条回答
  • 2020-12-12 13:06

    Make sure you have mod_rewrite enabled.

    restart apache
    

    and clear cookies of your browser for read again at .htaccess

    0 讨论(0)
  • 2020-12-12 13:07

    This looks like you have to enable .htaccess by adding this to your vhost:

    <Directory /var/www/html/public/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    

    If that doesn't work, make sure you have mod_rewrite enabled.

    Don't forget to restart apache after making the changes! (service apache2 restart)

    0 讨论(0)
  • 2020-12-12 13:10

    too late.. but for the benefit you can edit your .htaccess file comment this line

      #  RewriteRule ^ index.php [L]
    
    0 讨论(0)
  • 2020-12-12 13:14

    First enable a2enmod rewrite next restart the apache

    /etc/init.d/apache2 restart
    

    click here for answer these question

    0 讨论(0)
  • 2020-12-12 13:15

    I resolved by doing the following: Check if there is a module called rewrite.load in your apache at:

    cd /etc/apache2/mods-enabled/
    

    If it does not exist execute the following excerpt:

    sudo a2enmod rewrite
    

    Otherwise, change the Apache configuration file to consolidate use of the "friendly URL".

    sudo nano /etc/apache2/apache2.conf
    

    Find the following code inside the editor:

    <Directory /var/www/> 
       Options Indexes FollowSymLinks
       AllowOverride None
       Require all granted
    </Directory> 
    

    Change to:

    <Directory /var/www/> 
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    

    After that restart the Apache server via:

    sudo /etc/init.d/apache2 restart
    
    0 讨论(0)
  • 2020-12-12 13:19

    Alternatively you could replace all the contents in your .htaccess file

    Options +FollowSymLinks -Indexes
    RewriteEngine On
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    

    See the docs here. https://laravel.com/docs/5.8/installation#web-server-configuration

    0 讨论(0)
提交回复
热议问题