httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Narendra Verma" <narendra.ve...@impetus.co.in>
Subject RE: [users@httpd] Re: Extra trailing slash after the RewriteCond
Date Tue, 08 Apr 2008 13:12:50 GMT
RewriteRule ^(.*)$ http://www.redirectnew.com/$1 

Replace it by

RewriteRule ^(.*)$ http://www.redirectnew.com$1

May solve your problem.

Narendra
-----Original Message-----
From: Yashesh Bhatia [mailto:yasheshb@gmail.com] 
Sent: Tuesday, April 08, 2008 6:39 PM
To: users@httpd.apache.org
Subject: [users@httpd] Re: Extra trailing slash after the RewriteCond

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 <yasheshb@gmail.com> 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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message