2016-11-16 9 views
0

私は私が解決するのは難しい見つける数日以来の問題:(リダイレクトapacheの(2.2)

私はHTTP経由で私のgitのプロジェクトの内容を表示するにはgitwebを使用しています。しかし、私はことをしたくありません誰もがすべてのプロジェクトのルートフォルダにアクセスすることができ

私のHTTPSサーバのUIを実際には、アクセス権の観点から、各プロジェクトをポイントすることができ:。

の/ var/libに/ gitroot/gitのモジュール-TEST1 - > https // server.org/gitweb /?p = git-module-test1; a =要約
/var/lib/gitroot/git-module-test2 - > https // server.org/gitweb/?p = git-mod ULE-TEST2; =要約
等...

だから私はここでのhttps // server.org/gitweb/

のアクセスを避けたいが/etc/apache2/conf.dのconfigです/gitweb.conf

Alias /gitweb /usr/share/gitweb 

#RewriteEngine on 
#RewriteRule ^/gitweb/$/[L] # Is not working 
#RewriteRule ^/gitweb$/[L] # Is not working 

Redirect "/gitweb/$" "https//server.org" # Does not redirect anything !! 
#Redirect "/gitweb/" "https//server.org" # Redirect all ! 

<Directory /usr/share/gitweb> 
    Options FollowSymLinks +ExecCGI 
    AddHandler cgi-script .cgi 
</Directory> 

どうすればいいですか?

答えて

0

リダイレクトは、すべてをリダイレクトして、特定のURLをリダイレクトするとそのサブディレクトリまたは何か他のあなたが

RedirectMatch ^/gitweb/$ https//server.org/ 

^<のようなアンカーとに、RedirectMatchを使用しない場合は、正規表現をとらない - begginingをマーク一致する文字列の
$ < - 一致する文字列の末尾をマーク

関連する問題