我正在刷新我的Laravel基础知识,并且直接遇到了一个问题。
我正在使用Bitnami WAMP堆栈,并有一个Laravel项目设置和工作。我所做的第一个更改是将另一个路由添加到/routes/web.php文件中,如下所示...
Route::get('/hello', function () {
return 'Hello world';
});但是当我访问我的url www.example.com/hello时,我会得到一个404
工匠展示路线..。
| GET|HEAD | hello | | Closure | web 有人对故障排除有什么建议吗?会不会是我的Bitnami配置出了问题?
发布于 2018-06-29 02:37:20
我认为缓存的问题在于,尝试:
php artisan route: clear服务器端缓存也是可能的。
只需尝试安装https://github.com/barryvdh/laravel-debugbar,您就可以看到它是如何计算出路由的。
仍然可以在apache https://laravel.com/docs/5.6#web-server-configuration上查看rewrite_module
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]发布于 2018-06-29 03:26:17
最终成功地解决了这个问题。我需要将以下内容添加到我的Apache httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "C:/Bitnami/wamp/apache2/htdocs/myapp/public"
ServerName siteagent.test
<Directory "C:/Bitnami/wamp/apache2/htdocs/myapp/public">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>https://stackoverflow.com/questions/51089145
复制相似问题