Monday, January 11, 2016

redirect sub directory of apache svn (mod_dav_svn)



I've got a mod_dav_svn apache webserver serving up a big tree of svn. I need to move a sub tree to a new server (not svn). Is there any way to use some kind of rewrite to redirect all of the sub tree so people visiting old URLs will be redirected to the new URLs?



Example my tree is like this




folder
a
file1.html
file2.html
b
file3.html
file4.html


I can currently access these, served by mod_dav_svn at




http://svn.server/svn/folder/a/
http://svn.server/svn/folder/a/file1.html
http://svn.server/svn/folder/a/file2.html
http://svn.server/svn/folder/b/
http://svn.server/svn/folder/b/file3.html
http://svn.server/svn/folder/b/file4.html


I want to copy b to some other server so that those files are accessible at new URLs. eg.




http://new.server/someplace/b/
http://new.server/someplace/b/file3.html
http://new.server/someplace/b/file4.html


And I want redirects from the old places to redirect to the new places



http://svn.server/svn/folder/b/           -> http://new.server/someplace/b/
http://svn.server/svn/folder/b/file3.html -> http://new.server/someplace/b/file3.html

http://svn.server/svn/folder/b/file4.html -> http://new.server/someplace/b/file4.html


The problem is, mod_dav_svn is controlling everything below /svn on svn.server Is there a way to configure apache or mod_dav_svn to do this redirect of the b subfolder ond the old server?


Answer



Should be able to redirect before mod_dav_svn takes over.



Redirect permanent /svn/folder/b/ http://new.server/someplace/b/

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...