0

I have a subversion server that is working fine; however, I bought a tool that requires that the project have a "branches" subdirectory an is case sensitive. The entire repository already has projects with a "Branches" folder so I'm trying to write in a rewrite to the httpd.conf file. I've got the LoadModule uncommented and turned the RewriteEngine on, Apache starts but I don't get my desired result.

RewriteRule ^/Root/(.+)/branches(.*)  /Root/$1/Branches$2

If I use a RedirectMatch it works in the browser but still doesn't work in tool.

RedirectMatch ^/Root/(.+)/branches(.*)  /Root/$1/Branches$2 

I understand that Rewrite typically for rewriting to a file or physical location but I've seen some similar example when trying to solve mine. I am open to other approaches, I've looked into the < If > but it is beyond me.

5
  • Could you describe your desired result? Does this tool you have use the apache server? If so, what URL does it use?
    – Qben
    Sep 21, 2013 at 5:49
  • @Qben I want svn/Root/ProjectA/branches to "redirect" on the server-side to svn/Root/ProjectA/Branches. Our SVN is running in apache and that is not going to change.
    – Monso
    Sep 22, 2013 at 23:33
  • Since RedirectMatch working in the browser but not in the tool your tool probably handle redirects faulty, unless it access some other strange URL that is not matched. Do you have any log showing what URL the tool uses?
    – Qben
    Sep 23, 2013 at 6:11
  • Mybe you could solve it without a RewriteRule or RedirectMatch using a symlink instead?
    – Qben
    Sep 24, 2013 at 6:06
  • I don't understand what so confusing about the question. Of course I know what URL to tool is trying to access. Symbolic links won't work since it is a virtual host, the paths don't exist on the drive.
    – Monso
    Sep 24, 2013 at 18:43

1 Answer 1

0

Finally figured it out

    RewriteRule ^/Root/(.+)/branches(.*)  http://svn/Root/$1/Branches$2 [P]

Since it is virtual I needed to include the absolute web URL. Without the [P] flag (proxy) it was returning a 302 redirect, with the flag the server only handles the request and the client is simply returned the correct page from the single request.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .