redirection

.htaccess mod_rewrite redirection between domains

I have two domains, cshen.ca and cshen.net, both point to the same place. I'm trying to accomplish the following with mod_rewrite: cshen.net is 301 redirected to cshen.ca www.cshen.net or www.cshen.ca are both redirected to cshen.ca the path after the domain is preserved after being redirected, for example www.cshen.net/foo/bar/ would...

Bash redirection combined with "double pipe" notation

Is it possible to combine redirecting output to a file and pipes with ||? (Not sure what this is called) Example: (wget -qO- example.com/duff || exit) | some_processing >> outfile.txt If wget fails, I would like to exit and not run some_processing or create the blank file. ...

Can I redirect the stdout in python into some sort of string buffer?

I'm using python's ftplib to write a small FTP client, but some of the functions in the package don't return string output, but print to stdout. I want to redirect stdout to an object which I'll be able to read the output from. I know stdout can be redirected into any regular file with: stdout = open("file", "a") But I prefer a metho...

iis7 virtual-directory redirect change from iis6

I have an ASP.NET 3.5 application that started in 1.1 and has been ported from IIS5 to IIS6 and now we're going to IIS7. Back in the 1.1 days we implemented URL-rewriting functionality based on HTTP Modules that still works great - fairly complex logic that is very stable. It allows us to take URL's like this www.abc.com/merchant and ...

To redirect an user back to index.php after a handler

I put "username" and "password" to a form of mine. The action starts up a handler.php. The user sees then only a white page (handler.page) if he does not reload his browser at handler.php. If he does, the handler puts him to back to index.php. I would like to put the user automatically back to the homepage after being at handler.php wh...

Jersey - Redirection Using Get Not Put, Causes Redirection Loop

Hello chaps, I'm working on a web app that uses Jersey. I'm trying to implement a get-after-post sort of thing using a URIBuilder and a seeOther response. The aim is to redirect to the same URI the browser is already on, but to force a GET. It works a bit like this: Request comes in via PUT PUT request processed SeeOther response retu...

Redirect WebService

I want to redirect my webservice A to another webservice B. So, i set the redirection in IIS. However, consumers of my webservice A get an error while accessing the webservice because they get a 302 message; and they dont handle it. I dont want to force all my consumers to change their code to handle this. I dont want to change my webm...

Perl on Windows, file associations and I/O redirection

Can someone explain the difference between calling a perl script via file association versus calling the same script explicitly via perl.exe? Apparently I/O redirection doesn't work very well when the script is called via file association, and I would really like to know why. E.g. take a look at the Activestate FAQ for Perl on Window...

Cron job stderr to email AND log file?

I have a cron job: $SP_s/StartDailyS1.sh >$LP_s/MirrorLogS1.txt Where SP_s is the path to the script and LP_s is the path for the log file. This sends stdout to the log file and stderr to my email. How do I?: 1) send both stdout AND stderr to the logfile, 2) AND send stderr to email or to put it another way: stderr to both the logf...

BASH: error message does not get redirected to file

I have a bash script that simply calls different calls and redirect stdout and stderr outputs to different files. I've done this: command 1> datafile 2>> errorfile However, when the command is erroneous (e.g. wrong username and password combination given as arguments), the error message does not get redirected to the errorfile. I sti...

Redirect not working for me... any ideas greatly appreciated!

I have the following line in my IsapiRewrite.ini file: RewriteRule ^/test-url.asp$ http://www.google.co.uk/ [R=301,L] But it doesn't do anything... However, this DOES work: RewriteRule ^/test-url.asp$ / Is it a case of enabling Redirect or something like that? I would have thought that if the IsapiRewrite4.dll is running, the r...

Temporary Input Redirection in Bash

I am looking for a way to dump input into my terminal from a file, but when EOF is reached I would like input returned back to my keyboard. Is there a way to do this with Bash (or any other commonly-available *nix shell)? Details: I am debugging a server program which executes a fork to start a child process. Every time I start a debu...

Re-writing Page name

Link#1 "medical.html" we change that page to Link#2 "medical-transcription.html" I want the person who clicked Link#1 to go to Link#2, not our home page. It is transparent to the end user because they find the information they want and it allows us to pass along (and keep) our search engine rankings. ...

A way to figure out redirection URL

Given a URL A which gets redirected to a 3rd party website B, in my application I need to to find out URL B for the given url A and insert it in DB , this can be a windows application or web or whichever way is faster and easier using C#! Thanks ! P.S. I do not require the code to insert in DB. ...

Having problems with a Rewrite rule.

Hi, I have an application most of it is still in development that's why i need to block access on all pages but just not two of them. Suppose i have a.php all requests will be redirected to here except b.php. So i think there should be 3 rules: 1st: when a.php and b.php are requested they should be visible to user, 2nd: if anything ...

PSEXEC redirect output to local file

I need the correct way to accomplish this via a vbscript. This works fine from command prompt: psexec \\99.99.99.99 -u username -p password cmd.exe /c ver > output.txt From the vbscript: sTempFile = objFSO.GetTempName sCmd = "psexec \\" & sIP & " -u " & sDomain & "\" & sUser & " -p " & sPassword & " cmd /c ver > " & sTempFile ...

Google thinks my home page IS a trailing slash

I am desperate to know why Google webmaster tools AND analytics are registering my home page as a trailing slash?! There are no crawl errors, 401s, search issues, nothing wrong otherwise. My home page is written with a trailing slash and if a visitor does not include the slash, my site will automatically fetch the / and send them to ht...

Redirect stdout and stderr to a single file in dos

I'm trying to redirect all output (stdout + stderr) of a dos command to a single file: C:\>dir 1> a.txt 2> a.txt The process cannot access the file because it is being used by another process. Is it possible, or should I just redirect to two separate files? ...

URL redirection

When user write http://nextech.pk/ in the browser, I want to redirect to http://www.nextech.pk/ , So I want to embend www to the URL when user write nextech.pk in the browser How can I accomplish this? I think I need to write some rules in the web.cofig to accomplish this, but I don't know exactly Thanks...

How to redirect an entire range/block of IP addresses with PHP?

Hello all, I'm using the following snippet to redirect an array of IP addresses. I was wondering how I would go about adding an entire range/block of IP addresses to my dissallowed array... <?php // Let's redirect certain IP addresses to a "Page Not Found" $disallowed = array("76.105.99.106"); $ip = $_SERVER['REMOTE_ADDR']; if(in_arra...