{"id":1633,"date":"2012-10-30T12:59:58","date_gmt":"2012-10-30T04:59:58","guid":{"rendered":"http:\/\/rmohan.com\/?p=1633"},"modified":"2012-10-30T13:01:43","modified_gmt":"2012-10-30T05:01:43","slug":"url-redirection-in-apache-using-proxypass","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1633","title":{"rendered":"url redirection in apache using proxypass"},"content":{"rendered":"<p><strong>Url redirection in\u00a0Apache web server.<\/strong><\/p>\n<p>Here is a small example of url redirection in\u00a0Apache\u00a0using proxypass. I used this when I was using\u00a0Apache\u00a0as proxy to\u00a0Apache\u00a0tomcat using mod_jk.<\/p>\n<p>Example:<br \/> you want to forward <br \/> www.yourdomain.come\/abc\u00a0\u00a0\u00a0\u00a0\u00a0 to www.yourdomain.com\/linux\/commands\/abc<\/p>\n<p>Here is how you can do it. Open httpd.conf in your\u00a0favorite\u00a0editor. Add the following lines.<br \/> ProxyPass \/abc \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 http:\/\/localhost\/linux\/commands\/abc<br \/> ProxyPassReverse \/abc \u00a0\u00a0 http:\/\/localhost\/linux\/commands\/abc<\/p>\n<p>But while using above solution you may have to give trailing &#8220;\/&#8221; to correct it use the following rewrite rule.<br \/> RewriteEngine on<br \/> RewriteRule ^\/abc$ \/abc\/ [R]<\/p>\n<p>But for using the above solution you have to load modules mod_proxy and mod_rewrite.<br \/> Load the modules, add the rules, restart\u00a0Apache\u00a0 You are done. Please suggest if you know any better ways to do it. Remember that all my webapps is in tomcat and\u00a0Apache\u00a0is just front end.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Url redirection in Apache web server.<\/p>\n<p>Here is a small example of url redirection in Apache using proxypass. I used this when I was using Apache as proxy to Apache tomcat using mod_jk.<\/p>\n<p>Example: you want to forward www.yourdomain.come\/abc to www.yourdomain.com\/linux\/commands\/abc<\/p>\n<p>Here is how you can do it. Open httpd.conf in your favorite editor. Add [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1633"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1633"}],"version-history":[{"count":3,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1633\/revisions"}],"predecessor-version":[{"id":1636,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1633\/revisions\/1636"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}