Re: Redirect to other server if file/directory does not exists.

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

 



Hi.

I have a similar issue.

I need to make a rewrite rule for this URL:

/geturl?url="" class="moz-txt-link-freetext" href="http://example.com/somepicture.jpg">http://example.com/somepicture.jpg

to proxy it to the "url" parameter value.

So, i used rules like this:

RewriteEngine on
RewriteOptions Inherit
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteRule  ^/geturl?url="" $1         [P,L]

But if there is no such file "geturl", Apache responses with 404 error. If this file is in there, then it responses 200 and do nothing :)

I can't see any solution except writing a PHP-proxifying script.

05.08.2014 00:47, Mimiko пишет:
Hello.

I want to redirect/proxy all request to other server if file/directory does not exists locally. In apache's help I've found this exmaple:

RewriteCond %{REQUEST_URI}/$1 !-U
RewriteRule ^/(.*) http://otherserver/$1 [P,L]

But it works if file/directory exists, and shows 404 file not found if file does not exist. Why it does not proxy?



[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