Sponsored Content
Top Forums Web Development APACHE rewrite / redirect URL Post 302251522 by sysgate on Monday 27th of October 2008 10:25:35 AM
Old 10-27-2008
If you want to use apache's proxy, then go for the module. Since you haven't specified the apache version, I will link to version 1.3.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Apache Rewrite help!

I am trying to write RewriteRule on Apache_1.3.26 to get users web page from another server. for example if users tries to get web page on www.somedomain.com/~usersname it will get the web page from www.testdomain.com/~username without redirect and users will not be aware of any redirect... (1 Reply)
Discussion started by: hassan2
1 Replies

2. Cybersecurity

APACHE rewrite / redirect URL

Hello. I have scenario where a Client send request to Server1. Server1 send request to Server2. Request are xmlHTTPRequest - need to get data (XML) from Server2 back to client. Trying to use APACHE proxy... Anyone can help? What to download / configure / ...? Thank you for your help. (1 Reply)
Discussion started by: ampo
1 Replies

3. Web Development

Apache rewrite rules.

Hi, I am new to Apache but I have requirement as follows. if the url is http://images/data1/templates/ it should redirect to http:/172.20.224.23/templates/ if the url doesn't have "data1/templates" (mean http://images/) it should redirect to http://images:8080/. I tried as below ... (3 Replies)
Discussion started by: sambadamerla
3 Replies

4. Web Development

Regex to rewrite URL to another URL based on HTTP_HOST?

I am trying to find a way to test some code, but I need to rewrite a specific URL only from a specific HTTP_HOST The call goes out to http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena The ID in the middle is always random due to the cookie. I... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies

5. Red Hat

Need some help on tomcat URL rewrite or mod_jk

I am trying to remove the context name from the url of my server. Current URL - http://www.domainname.com/MyApp/ What I need to make is to make it avaialble at - http://www.domainname.com/ I have already tried couple of things like below - RewriteEngine On RewriteCond... (0 Replies)
Discussion started by: rockf1bull
0 Replies

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

7. Web Development

Append query string via URL rewrite in apache

Hi, Googled around but I couldn't find anything similar. I'm looking to do the following in apache.. if a user comes into the following URL. http://www.example.com/some/thing.cid?wholebunch_of_stuff_here keep the URL exactly as is BUT add &something at the very end of it. thanks in... (1 Reply)
Discussion started by: kmaq7621
1 Replies

8. Web Development

Mod_rewrite - URL rewrite based upon HTTP_REFERER

Hello, I have added following rewrite cond and rewrite rules but it does not work. RewriteCond %{HTTP_REFERER} ^http://192\.168\.1\.150/categories/.*$ RewriteRule ^(.*)$ http://www.blahblah.com/ When I hit url : http://192.168.1.150/categories/881-Goes?page=7 in my browser - it... (2 Replies)
Discussion started by: ashokvpp
2 Replies

9. Web Development

Apache rewrite/redirect parameters explanation

hi what is the meaning of the below code, please explain in details RewriteRule '^/(.*)$1$2/?' (1 Reply)
Discussion started by: raghur77
1 Replies

10. Web Development

Redirect URL containing #!

I have a Rewrite Rule that helps me redirect a page with no hindrance. I am rewriting mydomain.com/best to mydomain.com/#!/ using RewriteRule ^\/best\/? /#!/ Now I want to Rewrite mydomain.com/#!/best to (0 Replies)
Discussion started by: Junaid Subhani
0 Replies
AnyEvent::HTTPD::Request(3pm)				User Contributed Perl Documentation			     AnyEvent::HTTPD::Request(3pm)

NAME
AnyEvent::HTTPD::Request - A web application request handle for AnyEvent::HTTPD DESCRIPTION
This is the request object as generated by AnyEvent::HTTPD and given in the request callbacks. METHODS
url This method returns the URL of the current request as URI object. respond ([$res]) $res can be: o an array reference Then the array reference has these elements: my ($code, $message, $header_hash, $content) = [200, 'ok', { 'Content-Type' => 'text/html' }, '<h1>Test</h1>' }] You can remove most headers added by default (like "Cache-Control", "Expires", and "Content-Length") by setting them to undef, like so: $req->respond([ 200, 'OK', { 'Content-Type' => 'text/html', 'Cache-Control' => 'max-age=3600', 'Expires' => undef, }, 'This data will be cached for one hour.' ]); o a hash reference If it was a hash reference the hash is first searched for the "redirect" key and if that key does not exist for the "content" key. The value for the "redirect" key should contain the URL that you want to redirect the request to. The value for the "content" key should contain an array reference with the first value being the content type and the second the content. Here is an example: $httpd->reg_cb ( '/image/elmex' => sub { my ($httpd, $req) = @_; open IMG, "$ENV{HOME}/media/images/elmex.png" or $req->respond ( [404, 'not found', { 'Content-Type' => 'text/plain' }, 'not found'] ); $req->respond ({ content => ['image/png', do { local $/; <IMG> }] }); } ); How to send large files: For longer responses you can give a callback instead of a string to the response function for the value of the $content. $req->respond ({ content => ['video/x-ms-asf', sub { my ($data_cb) = @_; # start some async retrieve operation, for example use # IO::AIO (with AnyEvent::AIO). Or retrieve chunks of data # to send somehow else. } }); The given callback will receive as first argument either another callback ($data_cb in the above example) or an undefined value, which means that there is no more data required and the transfer has been completed (either by you sending no more data, or by a disconnect of the client). The callback given to "respond" will be called whenever the send queue of the HTTP connection becomes empty (meaning that the data is written out to the kernel). If it is called you have to start delivering the next chunk of data. That doesn't have to be immediately, before the callback returns. This means that you can initiate for instance an IO::AIO request (see also AnyEvent::AIO) and send the data later. That is what the $data_cb callback is for. You have to call it once you got the next chunk of data. Once you sent a chunk of data via $data_cb you can just wait until your callback is called again to deliver the next chunk. If you are done transferring all data call the $data_cb with an empty string or with no argument at all. Please consult the example script "large_response_example" from the "samples/" directory of the AnyEvent::HTTPD distribution for an example of how to use this mechanism. NOTE: You should supply a 'Content-Length' header if you are going to send a larger file. If you don't do that the client will have no chance to know if the transfer was complete. To supply additional header fields the hash argument format will not work. You should use the array argument format for this case. responded Returns true if this request already has been responded to. parm ($key) Returns the first value of the form parameter $key or undef. params Returns list of parameter names. vars Returns a hash of form parameters. The value is either the value of the parameter, and in case there are multiple values present it will contain an array reference of values. method This method returns the method of the current request. content Returns the request content or undef if only parameters for a form were transmitted. headers This method will return a hash reference containing the HTTP headers for this HTTP request. client_host This method returns the host/IP of the HTTP client this request was received from. client_port This method returns the TCP port number of the HTTP client this request was received from. COPYRIGHT &; LICENSE Copyright 2008-2011 Robin Redeker, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-08-04 AnyEvent::HTTPD::Request(3pm)
All times are GMT -4. The time now is 03:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy