[WebSVN] how to rewrite https://<hostname>/wsvn to https://<hostname>/wsvn/

View: New views
3 Messages — Rating Filter:   Alert me  

[WebSVN] how to rewrite https://<hostname>/wsvn to https://<hostname>/wsvn/

by Indra Gunawan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How can I force a rewrite of https://<hostname>/wsvn request to https://<hostname>/wsvn/

I have enabled Multiviews according to the documentation in install.html.

Both are not actually the same.  They return different listing of SVN repo from the parent root.

my httpd.conf:

<Location /wsvn/>
   Allow from all
   Require valid-user
   AuthName "NMTGRE Subversion Repository"
   AuthType Basic
   AuthLDAPBindDN "<bindDN>"
   AuthLDAPBindPassword password
   AuthLDAPUrl "ldap://<ldap>"
</Location>

I've googled for apache rewrite for adding trailing / to any URI but it is working for this.  It works for redirecting https://<hostname>/websvn or https://<hostname>/websvn/ to https://<hostname>/wsvn/

I am using WebSVN 2.2.1

Thank you.
-Indra

------------------------------------------------------
http://websvn.tigris.org/ds/viewMessage.do?dsForumId=1547&dsMessageId=2409692

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@...].

Re: [WebSVN] how to rewrite https://<hostname>/wsvn to https://<hostname>/wsvn/

by Quinn Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Make sure you have mod_alias loaded:

LoadModule alias_module modules/mod_alias.so

Then you can use this command:

<IfModule alias_module>
     RedirectMatch permanent ^/wsvn$ /wsvn/
</IfModule>

I suggest putting it just above the Location block for wsvn so they  
group together. FYI, the "^" means to start at the beginning of the  
request string, and "$" means that must be the end of the string, so  
the regular expression only matches "/wsvn" exactly.

  - Quinn


On Oct 21, 2009, at 2:17 AM, Indra Gunawan wrote:

> How can I force a rewrite of https://<hostname>/wsvn request to  
> https://<hostname>/wsvn/
>
> I have enabled Multiviews according to the documentation in  
> install.html.
>
> Both are not actually the same.  They return different listing of  
> SVN repo from the parent root.
>
> my httpd.conf:
>
> <Location /wsvn/>
>   Allow from all
>   Require valid-user
>   AuthName "NMTGRE Subversion Repository"
>   AuthType Basic
>   AuthLDAPBindDN "<bindDN>"
>   AuthLDAPBindPassword password
>   AuthLDAPUrl "ldap://<ldap>"
> </Location>
>
> I've googled for apache rewrite for adding trailing / to any URI but  
> it is working for this.  It works for redirecting https://<hostname>/
> websvn or https://<hostname>/websvn/ to https://<hostname>/wsvn/
>
> I am using WebSVN 2.2.1
>
> Thank you.
> -Indra
>
> ------------------------------------------------------
> http://websvn.tigris.org/ds/viewMessage.do?dsForumId=1547&dsMessageId=2409692
>
> To unsubscribe from this discussion, e-mail: [dev-
> unsubscribe@...].
------------------------------------------------------
http://websvn.tigris.org/ds/viewMessage.do?dsForumId=1547&dsMessageId=2409854

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@...].

smime.p7s (2K) Download Attachment

RE: Re: [WebSVN] how to rewrite https://<hostname>/wsvn to https://<hostname>/wsvn/

by Indra Gunawan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes!  This works.  It is also simpler than using Rewrite.

I did try Redirect before and I did not know that the start of URL Request is "/".

I used this before and obviously it did not work:
Redirect ^wsvn$ /wsvn

Anyway, I removed the complex rewrite for websvn also.

Here is my htpd.conf per your suggestion:

#Redirect /wsvn and /websvn to /wsvn/
RedirectMatch permanent ^/websvn/?$ /wsvn/
RedirectMatch permanent ^/wsvn$ /wsvn/
#WebSVN with Apache MultiViews
<Location /wsvn/>
   Allow from all
   Require valid-user
   AuthName "NMTGRE Subversion Repository"
   AuthType Basic
   AuthLDAPBindDN "<bindDN"
   AuthLDAPBindPassword password
   AuthLDAPUrl "ldap://<ldap>"
</Location>

It redirects /websvn, /websvn/, and /wsvn to /wsvn/

Thank you very much.  I spent all night last night figuring this and it turns out to be a simple solution after all.

-Indra

------------------------------------------------------
http://websvn.tigris.org/ds/viewMessage.do?dsForumId=1547&dsMessageId=2409874

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@...].