我在xampp上运行laravel,我在访问页面时遇到问题,
http://localhost/laravel/public/
我得到一个很好的登录页面
但是当我举例http://localhost/laravel/public/smokeyard
404
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
错误
路线:
Route::get('smokeyard', 'GuzzleController@smokeyard');
控制器:
function smokeyard(){
return view('smokeyard');
}
我的所有观点都位于资源文件夹中。
答案 0 :(得分:5)
如果您想在不运行fonct: function(/*no ovar*/) {
//...
oModel.read("/alertSet", {
success: function(data) {
//...
boo1 = /*new value*/;
alert(boo1);
}.bind(this)
});
}
的情况下访问laravel项目,则需要更改一些设置,
从您artisan serve
.htaccess
中的public folder
和paste
复制root folder
个文件
application
rename
server.php
醇>
现在转到root directory to index.php
查找要检查的网址
希望这会有所帮助
答案 1 :(得分:0)
运行php artisan serve
并在http://localhost:8000
访问您的服务器。你的路线应该可以正常工作。
您无法使用xampp直接通过文件夹结构访问您的laravel应用程序路径。您需要设置Web根目录以指向public
文件夹并访问localhost
或运行laravel服务器并使用它。这是因为当您以laravel方式访问路径时,URL重写将失败。