Re: [users@httpd] Redirect to other server if file/directory does not exists.

2014-08-05 Thread Mimiko
On 05.08.2014 15:40, Igor Cicimov wrote: RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteRule ^/(.*)$ http://other-server%{REQUEST_URI} [P,L] This worked. The problem alsa was because I was calling: httpd://

Re: [users@httpd] Redirect to other server if file/directory does not exists.

2014-08-05 Thread Igor Cicimov
> > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f > RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d > RewriteCond %{REQUEST_URI} ^/(.*)$ > RewriteRule ^/(.*)$ http://other-server/%1 [P,L] > > Does not work. Local resources if esists are shown, but remote resources > are 404 not found "/".

Re: [users@httpd] Redirect to other server if file/directory does not exists.

2014-08-05 Thread Mimiko
On 05.08.2014 11:36, Igor Cicimov wrote: RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond %{QUERY_STRING} ^url=(.*)$ RewriteRule ^/geturl$%1 [P,L] Nope, in my case it does not work. The link I use is not in query string as uses Ivan. So adapting like this: RewriteCond %

Re: [users@httpd] Redirect to other server if file/directory does not exists.

2014-08-05 Thread Ivan Bondarev
OMG, it worked as tiny swiss clocks! Thanks Igor. 05.08.2014 12:36, Igor Cicimov пишет: On 05/08/2014 5:30 PM, "Ivan Bondarev" > wrote: > > Hi. > > I have a similar issue. > > I need to make a rewrite rule for this URL: > > /geturl?url=http://example.com/somepi

Re: [users@httpd] Redirect to other server if file/directory does not exists.

2014-08-05 Thread Igor Cicimov
On 05/08/2014 5:30 PM, "Ivan Bondarev" wrote: > > Hi. > > I have a similar issue. > > I need to make a rewrite rule for this URL: > > /geturl?url=http://example.com/somepicture.jpg > > to proxy it to the "url" parameter value. > > So, i used rules like this: > > RewriteEngine on > RewriteOptions I

Re: [users@httpd] Redirect to other server if file/directory does not exists.

2014-08-05 Thread Ivan Bondarev
Hi. I have a similar issue. I need to make a rewrite rule for this URL: / ///geturl?url=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// //

[users@httpd] Redirect to other server if file/directory does not exists.

2014-08-04 Thread 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