mod rewrite - Changing the context root of an application -


i have 2 servers (dev1 , dev2) application context root app hosted on both these servers can access these application thier url e.g.

http://dev1:8080/app http://dev2:8080/app 

so want

 http://dev1/app1 redirect dev1 app     http://dev1/app2 redirect dev2 app   

i have apache 2.2 installed on dev1 server , tried following

httpd.conf

<ifmodule rewrite_module>      rewriteengine on      jkoptions +forwarduricompat      rewritecond %{request_uri} ^(.*)app1(.*)$      rewriterule ^(.*)app1(.*)$  $1app$2 [pt,l]       rewritecond %{request_uri} ^(.*)app2(.*)$      rewriterule ^(.*)app2(.*)$  $1app$2    [pt,l]  </ifmodule> 

worker.properties

worker.list=node1,node2  worker.node1.type=ajp13 worker.node1.host=dev1 worker.node1.port=8009   worker.node2.type=ajp13 worker.node2.host=dev2 worker.node2.port=8009 

mod_jk.conf

jkmount /app1/ node1 jkmount /app1/* node1  jkmount /app2/ node2 jkmount /app2/* node2 

edit: redirect working application url redirecting

http://dev1/app instead of (http://dev1/app1 or http://dev1/app2)


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -