简体   繁体   English

Apache Map 没有重定向的所有根路径

[英]Apache Map All Paths to Root Without Redirect

I want Apache to blindly give the root website directory the full URL without a concern for the path.我希望 Apache 盲目地为根网站目录提供完整的 URL 而不关心路径。 Reason being I have an Angular app that handles routing and it's at the root directory.原因是我有一个处理路由的 Angular 应用程序,它位于根目录中。

I've tried stuff like this:我试过这样的东西:

AliasMatch ^/(.+) /var/www/html/mywebsite.com

But it always results in an infinite loop.但它总是导致无限循环。

Essentially, I just want to disable path-directory resolution.本质上,我只想禁用路径目录解析。

EDIT: I should also clarify that I have multiple sites hosted on the same machine and still want that to function.编辑:我还应该澄清我在同一台机器上托管了多个站点,并且仍然希望 function。 I just don't want directory routing from within a single website.我只是不希望从单个网站内进行目录路由。

I figured out how to accomplish what I want while also having the neat side effect of allowing me to still have assets that can be reached through directory navigation:我想出了如何完成我想要的,同时还具有允许我仍然拥有可以通过目录导航访问的资产的简洁副作用:

FallbackResource /

Will use the root directory without changing the URL when no such directory the path specifies exists.当路径指定的目录不存在时,将使用根目录而不更改 URL。

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

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