How to make apache to read .htaccess files while do proxy to multiple virutual hosts -


i m using apache 2.4 , tomcat 8 on ubuntu 14 server. m using same server both 'dev' , 'test', im using virtual host in apache check request if comming , redirect differnt directory of tomcat related code resides. have requirement use .htaccess file prerender our site seo purpose.

as .htaccess file gets ignore tomcat in apache, each virtual host, want apache consider related .htaccess file , redirect request related virtual host.

is possible??

here both apache virtual host configuration files

test .htaccess file:

<virtualhost *:80>  serveradmin webmaster@localhost servername test.myapp.com serveralias www.test.myapp.com documentroot /opt/apache-tomcat-8.0.14/test.myapp.com/root  proxypass / http://test.myapp.com:8080/ proxypassreverse / http://test.myapp.com:8080/  errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined  <directory "/opt/apache-tomcat-8.0.14/test.myapp.com/root">     options indexes followsymlinks multiviews     allowoverride     order allow,deny     allow </directory>  </virtualhost> 

dev .htaccess file:

<virtualhost *:80>  serveradmin webmaster@localhost servername dev.myapp.com documentroot /opt/apache-tomcat-8.0.14/dev.myapp.com/root  proxypass / http://dev.myapp.com:8080/  proxypassreverse / http://dev.myapp.com:8080/  errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined  <directory "/opt/apache-tomcat-8.0.14/dev.myapp.com/root">     options indexes followsymlinks multiviews     directoryindex index.html     allowoverride      require granted </directory>  </virtualhost> 

in apache2.conf file, change this

<directory /var/www/>     options indexes followsymlinks     allowoverride     require granted </directory> 


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -