我知道这是一个常见的问题,我知道有一个简单的解决方案,但我无法得到我在网上找到的解决方案来处理我的情况。
我有这样一个地址:
https://localhost/cms但是,当访问者访问此地址时,apache无法找到资源,但如果访问者转到:
https://localhost/cms/正如预期的那样,它起作用了。因此,为了解决这个问题,我试图创建一个国防部重写条件,但我遇到了一些麻烦。到目前为止,这是我的conf文件:
<VirtualHost *:443>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.*)/cms
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1/ [L,R=301]
ProxyPreserveHost on
ProxyRequests off
ProxyPass /cms/ http://localhost:9000/cms/
ProxyPassReverse /cms/ http://localhost:9000/cms/
</VirtualHost>有什么建议吗?
发布于 2014-04-25 19:43:28
因此,我通过使用ReverseProxy找到了它,下面是更新的conf文件:
<VirtualHost *:443>
ProxyPreserveHost on
ProxyRequests off
ProxyPass /cms/ http://localhost:9000/cms/
ProxyPassReverse /cms/ http://localhost:9000/cms/
ProxyPass /cms http://localhost:9000/cms/
ProxyPassReverse /cms http://localhost:9000/cms/
</VirtualHost>https://stackoverflow.com/questions/23301604
复制相似问题