我正在关注laravel的快速启动,它说“类型/用户”但不适合我.
我在浏览器中写了http:// DomainServer / ProjectName / users并抛出:
The requested URL /ProjectName/users was not found on this server.
Laravel
我试过以下,
要启用apache模块mod_rewrite,也不起作用.
解决方法:
Linux环境中Apache Web Server和Laravel的步骤.
>打开httpd.conf
sudo vim /etc/httpd/conf/httpd.conf
# for debian users: /etc/apache2/apache2.conf
>确保DocumentRoot指向laravel项目的公共目录
>添加该路径的Directory元素和Allowoverride All …,如下所示
DocumentRoot "/var/www/html/laravel/public/"
Allowoverride All
>从../laravel/public/打开.htaccess并确保它具有以下内容
Options -MultiViews
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]
>重新启动httpd服务
sudo service httpd restart
>现在http:// DomainServer / users将在您的浏览器中运行.
标签:php,laravel
来源: https://codeday.me/bug/20190925/1816376.html