Hi all,
I am facing one problem in configuration of httpd-vhosts.
my requirment is if url comes from servername (i.e http://sutra) it
should redirect to my home page.if url comes from serverAlias(i.e
http://sutrateam) it should go to advance search page....if any one
knows how to do pls help me
below file is my vhost file
<VirtualHost *:80>
ServerName sutra
ServerAlias srishtisutra
ServerAlias sutrateam
ServerAlias sutrasrishti
DocumentRoot D:/project/sutra/public
<Directory "D:/project/sutra/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI}
[P,QSA,L]
</VirtualHost>
with regards
shiva
--
Posted via http://www.ruby-forum.com/.
Shiva, The easiest way to do that is to create a new vhost for sutrateam that redirects to http://sutra/advanced-search-page. On 11/22/07, Shiva Kumaran <lists at ruby-forum.com> wrote:> > Hi all, > > I am facing one problem in configuration of httpd-vhosts. > my requirment is if url comes from servername (i.e http://sutra) it > should redirect to my home page.if url comes from serverAlias(i.e > http://sutrateam) it should go to advance search page....if any one > knows how to do pls help me > > below file is my vhost file > > <VirtualHost *:80> > ServerName sutra > ServerAlias srishtisutra > ServerAlias sutrateam > ServerAlias sutrasrishti > DocumentRoot D:/project/sutra/public > <Directory "D:/project/sutra/public"> > Options FollowSymLinks > AllowOverride None > Order allow,deny > Allow from all > </Directory> > RewriteEngine On > # Check for maintenance file and redirect all requests > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > RewriteCond %{SCRIPT_FILENAME} !maintenance.html > RewriteRule ^.*$ /system/maintenance.html [L] > # Rewrite index to check for static > RewriteRule ^/$ /index.html [QSA] > # Rewrite to check for Rails cached page > RewriteRule ^([^.]+)$ $1.html [QSA] > # Redirect all non-static requests to cluster > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} > [P,QSA,L] > </VirtualHost> > > > with regards > shiva > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Andrei Maxim http://andreimaxim.ro -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071122/05c7c64d/attachment.html
Andrei Maxim wrote:> Shiva, > The easiest way to do that is to create a new vhost for sutrateam that > redirects to http://sutra/advanced-search-page.Thanks for ur reply.where to place the redirect to http://sutra/adv-se-page in vhost file -- Posted via http://www.ruby-forum.com/.
A basic vhost config would be:
<VirtualHost *>
ServerName sutrateam
ServerAdmin webmaster at localhost
RewriteEngine on
RewriteRule ^(.*)$ http://sutra/advanced-search-page$1 [L,R]
</VirtualHost>
On 11/22/07, Shiva Kumaran <lists at ruby-forum.com>
wrote:>
> Andrei Maxim wrote:
> > Shiva,
> > The easiest way to do that is to create a new vhost for sutrateam that
> > redirects to http://sutra/advanced-search-page.
>
> Thanks for ur reply.where to place the redirect to
> http://sutra/adv-se-page in vhost file
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
--
Andrei Maxim
http://andreimaxim.ro
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/mongrel-users/attachments/20071122/18d837de/attachment.html
Andrei Maxim wrote:> A basic vhost config would be: > <VirtualHost *> > ServerName sutrateam > ServerAdmin webmaster at localhost > RewriteEngine on > RewriteRule ^(.*)$ http://sutra/advanced-search-page$1 [L,R] > </VirtualHost>thanks andrei its working now. -- Posted via http://www.ruby-forum.com/.