httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yashesh Bhatia" <yashe...@gmail.com>
Subject [users@httpd] Extra trailing slash after the RewriteCond
Date Tue, 08 Apr 2008 11:48:03 GMT
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


Mime
View raw message