Sorry that should read The above works perfectly fine except that it adds an extra trailing slash to the redirected url so if i type http//www.redirectold.com or http//www.redirectold.com/
it gets redirected to http//www.redirectnew.com// Thanks. Yashesh Bhatia On Tue, Apr 8, 2008 at 5:18 PM, Yashesh Bhatia <[EMAIL PROTECTED]> wrote: > Hello: > > I'm trying to test the usage of RewriteCond and RewriteRule in > the > > ---------------------------------------------- vhost file > ------------------------------------------ > $ cat testredirect.conf > # > # test redirect sites > # > <VirtualHost 192.168.1.22:80> > ServerName www.redirectnew.com > DocumentRoot "/opt/httpd/htdocs/redirectnew" > <Directory "/opt/httpd/htdocs/redirectnew"> > AllowOverride All > Order allow,deny > Allow from 192.168.1. > </Directory> > </VirtualHost> > > <VirtualHost 192.168.1.22:80> > ServerName www.redirectold.com > RewriteEngine On > RewriteOptions Inherit > RewriteCond %{HTTP_HOST} ^www.redirectold.com$ [NC] > RewriteRule ^(.*)$ http://www.redirectnew.com/$1 [R=301,L] > </VirtualHost> > $ > > ------------------------------------------------------------------------------------ > The above works perfectly fine except that it adds an extra trailing > slash to the redirected url > so if i type > > http//www.redirectold.com > or http//www.redirectold.com/ > > it gets redirected to > http//www.redirectnew.com > > Any fix for this. > > Thanks. > > Yashesh > --------------------------------------------------------------------- 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: [EMAIL PROTECTED] " from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]