php Laravel4:在此服务器上找不到请求的资源 /admin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25031736/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 17:36:37  来源:igfitidea点击:

Laravel4 : The requested resource /admin was not found on this server

phphtmllaravel

提问by LoveAndHappiness

there is a very weird problem I face with simple Laravel routing.

我在使用简单的 Laravel 路由时遇到了一个非常奇怪的问题。

Because some screenshots, say sometimes more than 1000 words. Here is what I am encountering.

因为有的截图,有时候说1000多字。这是我遇到的。

I can't route to "admin"

我无法路由到“管理员”

It works perfectly fine, if I choose a different name

如果我选择不同的名称,它工作得很好

And I get a real exception, if the route really does not exist.

如果路线真的不存在,我会得到一个真正的例外。

It doesn't matter, if the route is set in laravel or not. It just won't accept the name "admin" and only "admin". Every other name is routed correctly.

路线是否设置在 laravel 中并不重要。它只是不接受名称“admin”而只接受“admin”。每个其他名称都正确路由。

Can't explain this. And wouldn't want to make a fresh laravel installation.

无法解释这一点。并且不想重新安装laravel。

I don't use appache, because "php artisan serve" does the job for me.

我不使用 appache,因为“php artisan serve”为我完成了这项工作。

Any clues?

有什么线索吗?

回答by marko

It may that under public you have a folder named admin. That can be source of your problems.

可能在 public 下你有一个名为 admin 的文件夹。这可能是您问题的根源。

回答by Hassan Raza

In folder public->admin place these files named

在文件夹 public->admin 中将这些文件命名为

.htaccess  
favicon.ico  
index.php  
robots.txt 
web.config

like

喜欢

enter image description here

在此处输入图片说明

and change your index.phpfile in admin folder
from this to
enter image description here

并将index.php管理文件夹中的文件
从此更改为
在此处输入图片说明

into this
enter image description here

进入这个
在此处输入图片说明

hopefully it will solve your problem.
It worked for me.

希望它能解决你的问题。
它对我有用。