Re: [users@httpd] redirect only if a URL does not exists

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

 



On 8/22/06, Lothar Krenzien <lkrenzien@xxxxxx> wrote:

Hi Joshua,

thanks for the hint with the loglevel. Now here's my httpd.conf :

ProxyRequests off
ProxyPass /sunreader/ http://localhost:8080/sunreader/
ProxyHTMLURLMap http://localhost:8080/sunreader/ /sunreader
ProxyHTMLLogVerbose On
LogLevel Debug


<Location /sunreader/>
        ProxyPassReverse /
        SetOutputFilter  proxy-html
        ProxyHTMLURLMap  /      /sunreader/
        ProxyHTMLURLMap  /sunreader     /sunreader
        RequestHeader    unset  Accept-Encoding
</Location>

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteLog "C:\Programme\xampp\apache\logs\rewrite.log"
 RewriteLogLevel 100

 # Update
 RewriteCond    %{REQUEST_URI} !-U
 RewriteRule    ^/(.*).do  http://localhost/Portal_Update.php [L]

 #RewriteCond   ^/conergy/(.*).do !-U
 #RewriteRule   ^/conergy/(.*).do  http://localhost/Portal_Update.php

 #RewriteCond   ^/suntechnics/(.*).do !-U
 #RewriteRule   ^/suntechnics/(.*).do  http://localhost/Portal_Update.php

 # Portal
 RewriteRule ^/conergy/(.*).do$ http://localhost/sunreader/$1.do?mandant=conergy [R,L]
 RewriteRule ^/suntechnics/(.*).do$ http://localhost/sunreader/$1.do?mandant=suntechnics [R,L]

 .....

</IfModule>

Note that I have mod_proxy enabled, because I want to redirect the requests with /sunreader/... to tomcat. But I tested it also with mod_jk with no difference.
And here's the rewrite.log

Too much stuff going on here.  You need to break this into smaller
problems that you can debug and solve independently.

It seems clear to me that the RewriteCond is working fine.  The
RewriteRule that follows seems a little weird.  If what you want is an
external redirect, you should add the R flag.

You should also avoid mixing RewriteRule and ProxyPass.  You can use
the [P] flag on RewriteRule to replace the ProxyPass.

Joshua.

---------------------------------------------------------------------
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