Another possible solution I can think of: NameVirtualHost 1.2.3.4:80 <http://1.2.3.4/> <VirtualHost _default_:80> # Virtual host that will collect all the request not hitting # the main virtual host (including application.example.com one) # and redirect them to server.example.com/application DocumentRoot /usr/local/apache2/htdocs Redirect permanent / http://server.example.com/application </VirtualHost> <VirtualHost 1.2.3.4:80 <http://1.2.3.4/>> # Your man virtual host DocumentRoot /usr/local/apache2/htdocs ServerName server.example.com . . . </VirtualHost>
Igor On Fri, May 7, 2010 at 1:21 PM, Igor Cicimov <icici...@gmail.com> wrote: > What happens if you try > > NameVirtualHost 1.2.3.4:80 > <VirtualHost 1.2.3.4:80> > > ServerName server.example.com > ServerAlias application.example.com > > RewriteEngine On > RewriteCond %{HTTP_HOST} ^application.example.com$ > > Redirect permanent / http://server.example.com/application > </VirtualHost> > > if Redirect command doesn't work you can try > > RewriteRule / http://server.example.com/application [R=301,L] > > instead. > > Igor > > > On Thu, May 6, 2010 at 11:49 PM, <john.c.kenn...@ldhenergy.com> wrote: > >> >> >> >> >> >> > >> > I get the same looping result. (I shortened application to app because >> > I am too lazy to type all that!): >> > The requested URL >> > /appappappappappappappappappappappappappappappappappappappappapp was >> > not found on this server. >> >> Did you remove any other Redirect rules in your VirtualHost container? I >> don't see how the above config could possibly cause a redirect like you >> are seeing, because once the redirect is made, the browser is no longer >> requesting http://application/ (it's requesting >> http://server/application). This rewrite only applies when the host name >> is "application". >> >> -- >> Justin Pasher >> >> >> No other redirects in in place. >> We are wondering (and, yes, I probably should have mentioned this) if the >> fact that we are using mod_jk is having an effect. >> Basically, this server uses mod_jk to point to 1 of 2 Tomcat5 servers for >> load balancing. I don't think it should cause a problem since the redirect >> happens before mod_jk does it's magic but maybe I am wrong in thinking >> that??? >> John >> >> 2 VirtualHost containers we have tried: >> >> NameVirtualHost 1.2.3.4 >> <VirtualHost 1.2.3.4> >> ServerName server.example.com >> ServerAlias application.example.com >> Redirect permanent / http://server.example.com/application >> </VirtualHost> >> >> And >> NameVirtualHost 1.2.3.4 >> <VirtualHost 1.2.3.4> >> ServerName server.example.com >> ServerAlias application.example.com >> RewriteEngine On >> RewriteCond %{HTTP_HOST} ^zemaqa$ [NC] >> RewriteRule . http://wltzemaq01.ldhenergy.net/zema [R=permanent] >> </VirtualHost> >> >> --------------------------------------------------------------------- >> The official User-To-User support forum of the Apache HTTP Server Project. >> See <URL:http://httpd.apache.org/userslist.html> for more info. >> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org >> " from the digest: users-digest-unsubscr...@httpd.apache.org >> For additional commands, e-mail: users-h...@httpd.apache.org >> >> >> >