简体   繁体   中英

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. Reason being I have an Angular app that handles routing and it's at the root directory.

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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