php - 无法在 Laravel 应用程序中运行 Laravel 5 应用程序 - 未找到 Http 异常
问题描述
我是 Laravel 的新手,并试图弄清楚这种情况。我有一个 Laravel 5 应用程序。现在我必须在其Sub Directory中进行一些更改来运行相同的应用程序。所以我所做的是,我将应用程序复制到v2
子目录中,如下所示:
.htaccessMain Application
和的根v2 Application
:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /
# Send requests to public directory...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ public/index.php [L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
</IfModule>
<IfModule security2_module>
SecRuleRemoveByTag unoeuro
</IfModule>
v2 Application
公共文件夹中的.htaccess :
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteBase /v2/
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
这是我v2 Application
通过http://localhost:8000/v2访问时的结果:
我尝试了很多方法,但都失败了。任何帮助将不胜感激!谢谢。
解决方案
推荐阅读
- anylogic - 特工无法离开“传送带进入”块。如何在将代理发送到流程图之前等待传送带上的“空间”?
- asp.net-web-api - SwaggerUI .net5,在 IIS 中部署时出错
- java - 如何将 Java 中的 DMY HH:MM:SS 字符串转换为 Julian Date?
- javascript - Ajax Javascript 在不刷新页面的情况下不会改变样式
- docker - 使用低 RAM 节点机器类型的 GKE docker 镜像拉取速度极慢
- security - QuickSight 行级安全性:DatasetRulesUnexpectedError
- algorithm - print() 算作基本指令吗?
- python - 同时按下两个按钮,GPIO.add_event_detect
- c# - 使用脚本重新定位后,Sprite 对象从游戏选项卡中消失
- hibernate - Hibernate 不会从序列中获取 FK 键的默认值