The requested URL /ProjectName/users was not found on this server. Laravel

后端 未结 7 2031
天涯浪人
天涯浪人 2020-12-01 19:57

I am following the quickstart of laravel and it said \"type /users\" but not working for me. I have wrote in the browser, http://DomainServer/ProjectName/

相关标签:
7条回答
  • 2020-12-01 20:47

    First find the htaccess file in your Laravel project

    next add the following coding in htaccess file

    <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    
    RewriteEngine On
    
    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]
    
    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    

    save the htaccess file

    and restart the apache server using following code

    sudo service apache2 restart
    

    remember htaccess file and index.php file must be available in same folder in your project

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