RewriteRule: Pattern matching and grouping part of the URL expands to its local filesystem path

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

 




   Hello everybody,

   I’ve checking all kinds of sources of information so far without success, I hope I didn’t miss anything.

   I have a very simple RewriteRule which should take the requested resource part. What I want to achieve is to prepend an string before that matched path. Something like: 

RewriteRule   ^(.*)$             http://myserver/special_path/$1 [R=301]

   I’d say that should take the requested resource path and redirect the client to a new location. It does work in some places, but I’d like to use under a conditional <If>. When I do
that, the match is instead expanded to the local filesystem path, if I request the “/“ (root) of the server, the client is being redirected to:

      http://myserver/special_path/var/www/html

   Never mind about the DocumentRoot path. Anyway, that’s not the desired behaviour. 

   Perhaps we’re doing something wrong, but what puzzles me is the fact that if move the redirect logic outside the <If> block, then it apparently works fine.

   Best,

   Gustau


Marfeel Solutions S.L.
Avda. Josep Tarradellas 20-30, 6th Floor,
08029 Barcelona, Spain


ES: (+34) 93 178 59 50 ext128
US: (+1) 917-341-2540 ext128
UK:  (+44) 207-048-37-28 ext128

https://www.marfeel.com/
Atenea Knowledge Base




[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