Xampp本地主机无法正常工作 [英] Xampp localhost not working
问题描述
我在xampp上运行laravel,访问页面时遇到问题,
http://localhost/laravel/public/
我得到一个很好的登录页面
但是,例如当我去http://localhost/laravel/public/smokeyard
I am running laravel on xampp and I have problem with accessing pages,
http://localhost/laravel/public/
I get a login page which is good
however when I go for example http://localhost/laravel/public/smokeyard
我收到The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
的404
错误
路线:
Route::get('smokeyard', 'GuzzleController@smokeyard');
控制器:
function smokeyard(){
return view('smokeyard');
}
我所有的视图都位于资源文件夹中.
All my views are located in resources folder.
推荐答案
如果要在不运行artisan serve
的情况下访问laravel项目,则需要更改一些设置,
if you want to access laravel project without running artisan serve
, you need to change few settings,
-
从
public folder
复制.htaccess
文件,然后将paste
文件复制到application
copy the
.htaccess
file from thepublic folder
andpaste
it in theroot folder
of yourapplication
rename
root directory to index.php
现在转到localhost/your_project_name/smokeyard
输入要检查的网址
now go to localhost/your_project_name/smokeyard
for the url you want to check
希望这会有所帮助
这篇关于Xampp本地主机无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!