Redirecting a subdirectory to another domain: Apache

This can be done by including the following directives:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ProxyPass /mail http://apollo.drjoel.info/mail
ProxyPassreverse / http://apollo.drjoel.info/

These should be included in the file:

/etc/apache2/httpd.conf if you have a single site on the server

/etc/apache2/sites-enabled/site.com.conf if you host it on i-mscp

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.