httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Bondarev <>
Subject Re: [users@httpd] Redirect to other server if file/directory does not exists.
Date Tue, 05 Aug 2014 07:29:51 GMT

I have a similar issue.

I need to make a rewrite rule for this URL:

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?

View raw message