Visit The New, Modern Unix Linux Community

Full Discussion: Need help with rewrite rule
Top Forums Web Development Need help with rewrite rule Post 302460648 by BSrikanthB on Thursday 7th of October 2010 01:43:32 PM
I have tried using the rewite rule you have suggested.But, it still does not work.

I actually wanted all requests to be redirected to the maintenace.html,except the image that I have tried using in the maintenace.html.

Below is the Rewrite rule
RewriteEngine on
RewriteRule !(/images/image.jpg) /maintenance.html
RewriteRule .* /maintenance.html

Srikanth Bodakunta.

---------- Post updated at 11:13 PM ---------- Previous update was at 05:42 PM ----------

The below rewrite condition worked for me.....

RewriteCond %{REQUEST_URI} !^/image.jpg  
RewrtiteRule ^/.* /maintenance.html

Thanks a lot.....
This User Gave Thanks to BSrikanthB For This Post:
Test Your Knowledge in Computers #901
Difficulty: Easy
Steve Jobs offered Linus Torvalds a job in 2000, on the condition that he stopped development on Linux.
True or False?

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I rewrite to use a while instead of find?

for FILE in `find /home/Upload/*` Need to use a while instead to prevent errors when the file is emptied (4 Replies)
Discussion started by: goodmis
4 Replies

2. Shell Programming and Scripting

grep help, how do i rewrite this

Thanks , franklin you method worked, i knew i had to use a while loop and getline in there just didnt know the proper order :) Hi everyone, im trying to make the following command line shorter by introducing a script that join up all the grep commands ./new1a < numbers.txt | grep -i -v '^a '... (5 Replies)
Discussion started by: weezybaby
5 Replies

3. UNIX for Dummies Questions & Answers

rewrite date

I'm looking to have function that takes the present month and rewrites it into this form: _06_ (june), _09_ (september), and so on.. I would like this to be a my $this_month=code that rewrites date function because I would like to be a able to call it multiple times in the script by writing... (5 Replies)
Discussion started by: marringi
5 Replies

4. Web Development

.htaccess Rewrite Rule

Hello All, I have been asked to create a .htaccess redirect. I have never attempted to work with one of these files. We have a pretty vanilla LAMP setup using rhel4 apache1.3 and php4.2.3. I was instructed to place the .htaccess file in the document root of the site and and to attempt to... (1 Reply)
Discussion started by: jaysunn
1 Replies

5. UNIX for Advanced & Expert Users

Apache rewrite rule help needed

Hi All, I want to redirect from http://localhost/abc/xyz/def?cc=dk&lc=da to http://localhost/abc/mnc/pdf?cc=dk&lc=da. Please suggest a rewrite rule. (0 Replies)
Discussion started by: jagnikam
0 Replies

6. UNIX for Advanced & Expert Users

[SOLVED] htaccess rewrite rule help!

hi there, I need that when user input it shows because of facebook likes, and I found out that this is set up as rewrite rule in .htaccess file? how to achieve it? thank you... :confused: ---------- Post updated at 04:47... (0 Replies)
Discussion started by: vogueestylee
0 Replies

7. Web Development

Rewrite Rule looping error

Hi, I have a domain "" and i wanted to redirect only request like " /index.html" to "". Please note that a extra string "?NEW=1" added at the end of the URL. So Request for REDIRECTS TO... (12 Replies)
Discussion started by: Paulwintech
12 Replies

8. Web Development

ReWrite rule giving a hard time.

Hi all, I am trying to find a rewrite rule that can help me with the following situation. So I am currently on a page which has a URL:!/shop/phones/max-plus/features/ Now when I hover over a certain link, I can see that it will goto: <a... (0 Replies)
Discussion started by: Junaid Subhani
0 Replies
DACS_UPROXY(8)						     DACS Web Services Manual						    DACS_UPROXY(8)

dacs_uproxy - minimal HTTP proxying SYNOPSIS
dacs_uproxy [dacsoptions[1]] DESCRIPTION
This web service is part of the DACS suite. The dacs_uproxy web service accepts an incoming HTTP request (the initial request), then reissues a nearly identical HTTP request to a different URL (the proxied request) and returns its unaltered response. The initial request must use either the GET or POST HTTP method; the proxied request will use the same method as the initial request. Note that the origin server (the web server that receives the proxied request) will see a request that originates at the host that runs dacs_uproxy, not the host that issues the initial request. When run on a firewall host, the program can be useful for forwarding incoming requests to interior hosts. An origin server does not need to be running DACS. All access control is performed by the jurisdiction that runs dacs_uproxy. Similarly, the program can be useful for forwarding requests that originate behind the firewall, subject to access control permission. dacs_uproxy is not a transparent proxy server. A request URL must be explicitly addressed to it and include a (partial) name for the target resource. Security The program must be configured with care because it can expose otherwise inaccessible hosts to arbitrary HTTP requests from any source that can connect to dacs_uproxy. Particular care must be taken if a program that is invoked by dacs_uproxy generates a redirect that may be handled internally by the program's web server. In this event the new request arising from the redirection will not automatically be subjected to access control because the new request does come through dacs_uproxy. Therefore, local redirects must be avoided by proxied web services, resources that might be invoked through a local redirect must be publicly accessible, or authorization checking must somehow be arranged for these resources. Access control rules are primarily responsible for expressing restrictions on what can be proxied and who can use this service. By default, all access to this service is denied. Additionally, UPROXY_APPROVED[2] directives must be configured to allow proxying to specific origin servers. Although in its current form the program has the effect of anonymizing the proxied request, this is more of a bug than a feature. Future versions may forward an initial request's headers and other information. With the exception of the Cookie header, most request headers that accompany the initial request are sent with the proxied request. dacs_uproxy makes no attempt to "impersonate" the user's host, however. Therefore, to the origin server it appears as if the request is coming from dacs_uproxy and the IP address from which the forwarded request is sent. Any cookies sent with the initial request are interpreted by dacs_uproxy (e.g., to identify the user making the request for access control purposes). At present, it is not possible to forward cookies with the proxied request. So that the proxied web service can tell that it is being invoked by dacs_uproxy, an extension header named DACS-Uproxy-Via is included with the forwarded request. Its value is the URL of dacs_uproxy with the proxied host appended. With Apache, its value can be accessed from the environment variable HTTP_DACS_UPROXY_VIA. If dacs_uproxy is passed a DACS_APPROVAL[3] value, that value is forwarded with the request through the DACS-Uproxy-Approval header and made available by Apache in the HTTP_DACS_UPROXY_APPROVAL environment variable. A program invoked indirectly through dacs_uproxy can use this information to confirm that DACS authorized the request. If the forwarded request generates a redirect (a 3xx class HTTP status code is returned), it causes dacs_uproxy to return the redirection request. The program is a minimal or "micro" HTTP proxy, hence the u in dacs_uproxy should really be the Greek letter mu. Web Service Arguments With some exceptions, all arguments passed to dacs_uproxy are forwarded to the proxied request and are not interpreted by dacs_uproxy. The first exception is DACS_ACS[4]. Another exception is DACS_UPROXY; if its value is DEBUG, debugging output is produced. Neither of these arguments is forwarded with the proxied request. Operation A specification of the proxied request appears as a component of the initial request. It is best to explain this with an example. Let us assume that the URL for the dacs_uproxy that the client wants to use is Let us also assume that the client wants to access a web service at (the proxied host) and that this web service can be invoked from (the proxying host) as To achieve this, the client would invoke this URL: Note that no scheme is included with the name of the proxied host. A port number may follow it, however, and any path components that follow are appended (after the mapping specified by UPROXY_APPROVED) to form the final proxied URL. For this example to be authorized, an access control rule must grant the user access to the initial URL. Whether there is additional access control enforced at the proxied host is the responsibility of a web administrator. A simple rule that grants access to any authenticated user looks like this: <acl_rule status="enabled"> <services> <service url_expr='"${Conf::dacs_cgi_bin_prefix}/dacs_uproxy"'/> <service url_expr='"${Conf::dacs_cgi_bin_prefix}/dacs_uproxy/*"'/> </services> <rule order="allow,deny"> <allow> user("auth") </allow> </rule> </acl_rule> Most sophisticated rules may of course be used to further constrain how dacs_uproxy can be used and by whom. The UPROXY_APPROVED[2] directive must be configured before dacs_uproxy will do anything, even if otherwise permitted by an access control rule. If SSL is used for the proxied request, the usual DACS configuration directives for SSL apply - see dacs.conf(5)[5]. SSL can be used for the proxied request independently of whether it is used for the initial request. DIAGNOSTICS
The program exits 0 if everything was fine, 1 if an error occurred. BUGS
The implementation may not yet fully conform to RFC 2616[6]. SEE ALSO
RFC 2616[6] AUTHOR
Distributed Systems Software ([7]) COPYING
Copyright2003-2012 Distributed Systems Software. See the LICENSE[8] file that accompanies the distribution for licensing information. NOTES
1. dacsoptions 2. UPROXY_APPROVED 3. DACS_APPROVAL 4. DACS_ACS 5. dacs.conf(5) 6. RFC 2616 7. 8. LICENSE DACS 1.4.27b 10/22/2012 DACS_UPROXY(8)

Featured Tech Videos

All times are GMT -4. The time now is 03:44 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy