Extra trailing slash after the RewriteCond

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux