简体   繁体   English

如何在slim3框架路由的slim3框架中转义子文件夹

[英]How to escape subfolder in slim3 framework being routed by slim3

I have a project built with slim 3 and is working as expected ( http://localhost/slimapp/ ). 我有一个使用slim 3构建的项目,并且按预期方式工作( http:// localhost / slimapp / )。 Now what I want to do is in one of the subfolder run an Angular2 application. 现在我要做的是在一个子文件夹中运行Angular2应用程序。 But as I try to access the subfolder ( http://localhost/slimapp/angularapp/ ) via browser it is redirected to index.php of slim3, which is quite obvious. 但是,当我尝试通过浏览器访问子文件夹( http:// localhost / slimapp / angularapp / )时,它被重定向到slim3的index.php,这非常明显。 What I want to achieve is when I visit http://localhost/slimapp/angularapp/ this URL should not be redirected through slim3 .htaccess and it should run an angular application. 我想要实现的是,当我访问http:// localhost / slimapp / angularapp /时,不应通过slim3 .htaccess重定向此URL,而应运行一个有角度的应用程序。

So far I tried in .htaccess is add 到目前为止,我尝试在.htaccess中添加

RewriteRule ^angularapp($|/) - [L,NC]

This results in 404 not found a page for http://localhost/slimapp/angularapp/ . 结果导致404找不到http:// localhost / slimapp / angularapp /的页面

Any help is much appreciated. 任何帮助深表感谢。 Thanks 谢谢

无需在.htaccess级别上重写它,只需为该特定路径从slim创建一条Web路由,因此您无需访问浏览器,而可以访问Slim App,它将为您访问angular应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM