Apache /foo/to/foo/index.html的Mod_代理重写规则帮助
使用mod_代理,我需要将/foo/requests重定向到/foo/index.html。因此,如果用户输入:他们应该被重定向到 我尝试了以下规则,但无效:Apache /foo/to/foo/index.html的Mod_代理重写规则帮助,apache,redirect,mod-proxy,proxypass,Apache,Redirect,Mod Proxy,Proxypass,使用mod_代理,我需要将/foo/requests重定向到/foo/index.html。因此,如果用户输入:他们应该被重定向到 我尝试了以下规则,但无效: <Location /foo/> RequestHeader set Host example.com </Location> ProxyPass /foo/ https://example.com/foo/index.html ProxyPassReverse /foo/
<Location /foo/>
RequestHeader set Host example.com
</Location>
ProxyPass /foo/ https://example.com/foo/index.html
ProxyPassReverse /foo/ https://example.com/foo/index.html
RequestHeader set Host example.com
ProxyPass/foo/https://example.com/foo/index.html
ProxyPassReverse/foo/https://example.com/foo/index.html
虽然这适用于对*的任何请求,但不适用于。关于如何使用重定向才能正常工作的任何帮助?在请求命中代理之前,您需要向index.html添加一个正常重定向
<Location /foo/>
RequestHeader set Host example.com
</Location>
RewriteRule ^/foo(/|)$ /foo/index.html [NC]
ProxyPass /foo/ https://example.com/foo/
ProxyPassReverse /foo/ https://example.com/foo/
RequestHeader set Host example.com
重写规则^/foo(/|)$/foo/index.html[NC]
ProxyPass/foo/https://example.com/foo/
ProxyPassReverse/foo/https://example.com/foo/
在请求命中代理之前,您需要向index.html添加一个普通重定向
<Location /foo/>
RequestHeader set Host example.com
</Location>
RewriteRule ^/foo(/|)$ /foo/index.html [NC]
ProxyPass /foo/ https://example.com/foo/
ProxyPassReverse /foo/ https://example.com/foo/
RequestHeader set Host example.com
重写规则^/foo(/|)$/foo/index.html[NC]
ProxyPass/foo/https://example.com/foo/
ProxyPassReverse/foo/https://example.com/foo/
无法仅使用ProxyPass指令执行此操作?它似乎无法执行重定向。我有一个问题,没有办法只使用ProxyPass指令吗?它似乎不能重定向。我有一个403