apache rewrite question
am 26.10.2009 12:50:53 von joydeep
Hello,
Here in my debian lenny box rewrite stuff is working well in .htaccess file.
For viewvc ( web based svn ) I have the following config . ( Not a vhost )
``````````````````````````
ScriptAlias /svn /usr/lib/cgi-bin/viewvc.cgi
SSLRequireSSL
AuthType Basic
AuthName "requires a password"
AuthUserFile /home/svn/PASSWD
Require valid-user
```````````````````````````````
So from both internet and intranet viewvc requires https://
I wounder if there is any way to redirect http to https when visit
http:///svn or http:///svn in the above config ?
Is it possible ?
Thanks
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: apache rewrite question
am 26.10.2009 13:06:17 von Tom Evans
On Mon, 2009-10-26 at 17:20 +0530, J. Bakshi wrote:
> Hello,
>
> Here in my debian lenny box rewrite stuff is working well in .htaccess file.
>
> For viewvc ( web based svn ) I have the following config . ( Not a vhost )
>
> ``````````````````````````
> ScriptAlias /svn /usr/lib/cgi-bin/viewvc.cgi
>
> SSLRequireSSL
> AuthType Basic
> AuthName "requires a password"
> AuthUserFile /home/svn/PASSWD
> Require valid-user
>
> ```````````````````````````````
>
> So from both internet and intranet viewvc requires https://
> I wounder if there is any way to redirect http to https when visit
> http:///svn or http:///svn in the above config ?
> Is it possible ?
> Thanks
>
1) Turn off SSLRequiredSSL
2) Add the appropriate rewrite rule:
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/svn
RewriteCond %{HTTP_HOST} (.*)
RewriteRule ^/svn/(.*) https://%1/svn/$1
If that doesn't work (thats off the top of my head) turn on the rewrite
log and see why.
Cheers
Tom
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: apache rewrite question
am 26.10.2009 13:38:03 von joydeep
Tom Evans wrote:
> On Mon, 2009-10-26 at 17:20 +0530, J. Bakshi wrote:
>
>> Hello,
>>
>> Here in my debian lenny box rewrite stuff is working well in .htaccess file.
>>
>> For viewvc ( web based svn ) I have the following config . ( Not a vhost )
>>
>> ``````````````````````````
>> ScriptAlias /svn /usr/lib/cgi-bin/viewvc.cgi
>>
>> SSLRequireSSL
>> AuthType Basic
>> AuthName "requires a password"
>> AuthUserFile /home/svn/PASSWD
>> Require valid-user
>>
>> ```````````````````````````````
>>
>> So from both internet and intranet viewvc requires https://
>> I wounder if there is any way to redirect http to https when visit
>> http:///svn or http:///svn in the above config ?
>> Is it possible ?
>> Thanks
>>
>>
>
> 1) Turn off SSLRequiredSSL
> 2) Add the appropriate rewrite rule:
>
> RewriteCond %{HTTPS} off
> RewriteCond %{REQUEST_URI} ^/svn
> RewriteCond %{HTTP_HOST} (.*)
> RewriteRule ^/svn/(.*) https://%1/svn/$1
>
> If that doesn't work (thats off the top of my head) turn on the rewrite
> log and see why.
>
> Cheers
>
> Tom
>
Hello Tom,
I have inserted the rules but no effect. I'll look into the log. But I
like to mention that I get partial success with
Redirect permanent /svn https://192.168.1.1/svn
non http version redirect to https://192.168.1.1/svn BUT browser (
firefox) reports
``````````````````
The page isn't redirecting properly
```````````````````
and apache error log says
`````````````````
URL /svn/
```````````````
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org