httpd.conf
現在、ポート 80 からポート 8080 にすべてのリクエストを転送し、GlassFish アプリケーション サーバーによって処理されるように、ファイルに次のルールがあります。
<VirtualHost *:80>
ServerAdmin admin@myserver.com
ServerName myserver.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
http://myserver.com/
ここで、 へのすべてのリクエストが転送されhttp://myserver.com/page/index.html
、その URL がhttp://myserver.com/
クライアントのブラウザに表示されるようにするルールを追加する必要があります。上記の中に次のルールを追加しようとしましたVirtualHost
:
RewriteEngine On
RewriteRule http://myserver.com/ http://myserver.com/page/index.html
また
RewriteEngine On
RewriteRule ^/ http://myserver.com/page/index.html
また
RewriteEngine On
RewriteRule ^/index.html http://myserver.com/page/index.html
ただし、にアクセスするhttp://myserver.com/
と、ブラウザに次のエラーが表示されます: This webpage has a redirect loop
。3 番目のルールは、私が に行く場合にのみ機能しhttp://myserver.com/index.html
ます。
私は Apache のルールを書くのがまったくの初心者です。したがって、ここで私が間違っていたことを教えていただければ、非常に感謝しています:)。
アップデート:
次のルールは完全に機能します。
RewriteEngine On
RewriteRule ^/$ /page/index.html [R]