I searched through internet but found no matching question or post. I spent nights on unsuccessful attempts in getting it to work. I would really appreciate if someone could help and give pointers to get this advanced mod_rewrite working. (You may want to jump to The Problem directly below.)
Environment: I have installed websvn latest version on Apache 2.x with MultiView feature which generates URLs in below format without help of any rewrite rules:
https://svnweb.hostname.com/wsvn/Group.Repname/path/to/files/and/folders/in/svn/
Here the "Group" is nothing but SVNParentPath and "Repname" is actual SVN repository. Please note the "." between Group and Repname.
I have SVN 1.7 + Apache 2 configured and below is the URL format:
https://svn.hostname.com/Group/Repname/path/to/files/and/folders/in/svn/
The problem has nothing to do with this SVN URLs. To limit and manage user access to SVN repositories I have configured LDAP auth and LDAP Group based access for each Repname. This configuration is done automatically with help of scripts created by me.
The Requirement/Problem: I want to get /wsn/Group.Repname/ converted to /Group/Repname/ in URL where WEBSVN is using MultiView apache feature to construct its urls.
If you look closely, "Group" and "Repname" are not separate folders in WEBSVN URL and do not match with SVN URL path for repository. I would like to use same svn.hostname.com LDAP auth and LDAP group based permissions used for each Repname for svnweb.hostname.com. To make it work svnweb URL must be matching with SVN server URL like
This: https://svnweb.hostname.com/Group/Repname/path/to/files/and/folders/in/svn/
and not https://svnweb.hostname.com/wsvn/Group.Repname/path/to/files/and/folders/in/svn/
Possible Solution and Limitations: To achieve/fix this, i do not want to modify web application or create new apache LDAP auth and LDAP group configuration supporting "Group.Repname" in path. Imagine over 500+ SVN repositories and the maintenance overhead. I think mod_rewrite can help me to achieve the rewritten URL for me and secure WEBSVN making sure people get access to what they are supposed to access.
I tried several options with rewrite but i could not get /wsn/Group.Repname/ converted to /Group/Repname/. Please let me know if you have any idea how this can be achieved using rewrite. Thanks for reading through, I appreciate your comments and suggestions.
Try the following:
[^./]+
means "more then one sign, but not a point or a slash",.+
means "more than one sign". You might want to addR=301
afterNC
if the redirect should be permanent.