0

I have configured apache 2.2 webserver with tomcat. I want static files of my web application to be served using apache. I made a virtual host entry in httpd.conf

<VirtualHost *:8080>
Alias webcommon_alias C:/webcommon_bk

JkMountFile D:/xampp/apache/conf/myexample.net.properties
ServerName myexample.net
ErrorLog logs/myexample.net-error_log
CustomLog logs/myexample.net-access_log common

<Directory C:/webcommon_bk>
    Order allow,deny
    Allow from all
    RewriteEngine On
    RewriteBase /webcommon/
    RewriteRule ((.*)\.(js|css|html|gif|png)$) webcommon_alias/$1
</Directory>    

</VirtualHost>

But when i fetch this file in browser http://myexample.net:8080/webcommon/img/aboutBox.png i get Object not found! The requested URL was not found on this server.

Parminder Singh
  • 313
  • 1
  • 6
  • 12

1 Answers1

0

Try this instead:

<VirtualHost *:8080>
Alias /webcommon C:/webcommon_bk

JkMountFile D:/xampp/apache/conf/myexample.net.properties
ServerName myexample.net
ErrorLog logs/myexample.net-error_log
CustomLog logs/myexample.net-access_log common

<Directory C:/webcommon_bk>
    Order allow,deny
    Allow from all
    RewriteEngine On
    RewriteRule ((.*)\.(js|css|html|gif|png)$) /webcommon/$1.$2
</Directory>    

</VirtualHost>
arco444
  • 22,002
  • 12
  • 63
  • 67