過去 2 日間、私は自分の問題を解決するために多くの時間を費やしてきました。誰かが私を助けてくれるかもしれません。
問題: さまざまな URL を、artifactory に使用される 1 つの tomcat webbase-dir にリダイレクトする必要があります。次の URL は tomcat/artifactory webapp を指す必要があります。
maven-repo.example.local ; maven-repo.example.local/artifactory ; srv-example/アーティファクトリ
ここで、maven-repo.example.local はサーバー ホスト名の dns です: "srv-example" JK_mod モジュールを介して tomcat アプリにアクセスしています。webapp は ROOT ディレクトリにあります これは私がこれまでに得たものです:
<VirtualHost *:80>
#If URL contains "artifactory" strip down and redirect
RewriteEngine on
RewriteCond %{HTTP_HOST} ^\artifactory\$ [NC]
# (how can I remove 'artifactory' from the redirected parameters? )
RewriteRule ^(.*)$ http://maven-repo.example.local/$1 [R=301,L]
ServerName localhost
ErrorLog "logs/redirect-error_log"
</VirtualHost>
<VirtualHost *:80>
ServerName maven-repo.example.local
ErrorLog "logs/maven-repo.example.local-error.log"
CustomLog "logs/maven-repo.example.local-access.log" common
#calling tomcat webapp in ROOT
JkMount /* ajp13w
</VirtualHost>
webapp は「maven-repo.example.local」で動作していますが、「maven-repo.example.local/artifactory」では tomcat が 404 - 「要求されたリソース () は利用できません」を返します。google.com などの別のページにリダイレクトしても、mod_rewrite の効果はないようです。
「system32/drivers/hosts」ファイルに追加されたmaven-repo.example.localを使用して、Windows 7でテストしています
前もって感謝します!