redirect

How do you redirect in ColdFusion and control the status code (i.e. 301 instead of a 302)

This code does a redirect, but uses a 302 status code: <cflocation url="http://stackoverflow.com" addToken="no" /> I found this on the Internet, but I think it only works in ColdFusion8. I am using ColdFusion7. <cflocation url="http://stackoverflow.com" addToken="no" statuscode="301" /> Hoe do you control the status code in Cold...

htaccess Redirect 301 problem .. all redirects with one string fail to redirect and 404

So I have moved a website and am trying to 301 redirect everything, which I do quite often so this is a weird problem but probably something stupid I'm not seeing. ALL of my redirects are working fine, except any redirect that the first string starts with "/Dining" or "/dining" are failing. For example, this redirect works fine- Redir...

Ruby, post and redirect

Hi! I have situation like this: user submits form with action='/pay' in '/pay' I have to add some additional parameters and send post request to www.paymentprovider.com/new_payment The problem is that I want to post and redirect (at the same time) user to this new website www.paymentprovider.com/new_payment. Currently I am using N...

How do I forward a request to a different url in python

I have been looking for the syntax to redirect a special url to a remote server to do some XSS testing. Any ideas? import SimpleHTTPServer import SocketServer class myHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): print self.path if self.path == '/analog': -------------------->return "http://...

How to redirect output away from /dev/null

I have an application that runs the a command as below: <command> <switches> >& /dev/null I can configure <command>, but I have no control over <switches> . All the output generated by this command goes to /dev/null. I want the output to be visible on screen or redirected to a log file. I tried to use freopen() and related functions t...

Redirect to a page that uses basic authentication [PHP]

I'm trying to redirect to a page that uses basic authentication, with no success so far. Most examples I found online where to either use fopen or curl to request a resource, which I don't want to do. I've tried putting in the header the "Authorization: Basic" plus the encoded user:password, but it didn't work. Is it because I first ne...

I'm not sure if I should use a redirect

Hi there, I have an affiliate link on my webpage. When you click on the link it follows the href value which is as follows: www.site_name.com/?refer=my_affiliate_id This would be fine, except that the site offers no tracking for the ads, so I can't tell how many clicks I am getting. I could easily implement my own tracking by changin...

Redirecting user to a folder but show another domain

Hello, I am using htaccess to redirect people from a domain that is registered on my host to a folder. Ex: the user type www.my2nddomain.com and I redirect them to www.my1stdomain.com/folder. But I wanted to show the domain the user typed instead of the address with the folder on it. How do I do it? Thanks in advance! ...

Can Apache configuration check cookies?

My situation: We have a mobile version of our website, and want to start redirecting mobile users to it. The plan is to do this in Apache httpd.conf or .htaccess, using something like this: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} (iPhone|Blackberry|...) RewriteRule (.*) mobile/$1 However we want there to be a way for users t...

Is it possible to send an email and auto redirect in single php file?

As the title said: Is it possible to send an email (using php mail()) and after sending the email, auto redirect to another page. All the codes will be in single php file? Code-wise, should be something like this: if(mail(argument...)){ header("Location: www.google.com"); } I think I would get a: "Error: header information alrea...

SWFObject redirectUrl not functional with ExpressInstall

How do you specify a redirect URL for the adobe flash express install? I'm using swfobject 2.2, and while I thought MMredirectURL in the flashvars might be what I needed, this just doesn't work. I also tried setting redirectUrl in the attributes object before embedding the swf, but this doesn't work either. What is the proper way to spe...

Possible to create this redirecting route in Rails?

Is it possible to do a redirect in the routes file of a Rails app? Specifically, I'd like to forward /j/e to /javascripts/embed.js Right now the only way I can think to do it is to create a j controller with an e method that redirects to that. ...

How do I conditionally redirect the output of a command to /dev/null?

I have a script. I would like to give this script a quiet mode and a verbose mode. This is the equivalent of: if $verbose then redirect="> /dev/null" fi echo "Verbose mode enabled" $redirect # This doesn't work because the redirect isn't evaluated. I'd really like a better way of doing this than writing if-elses for every statemen...

XAMPP Redirecting to XAMPP directory on Internal Network

I installed XAMPP on my desktop. I set up vhosts for about 5 sites and they are all working properly from the desktop itself. The problem arises whenever I try to access these vhosts from my laptop. I changed the hosts file on the laptop to redirect the laptop dev.domain.com requests to the desktop, however, when I try to access these ...

How to get the HTML source code after executing header(location:URL)

Hi My web hosting provider does not permit to use curl FOLLOWLOCATION option so I'm trying to do it manually by using the header function. My problem is that I need to keep my PHP script running and to be able to get the redirected URL data for parsing. How do I do that? ...

how to redirect page if parameter set?

hey i want to make a thing but i need some help. ive got an index.php with codes. and i added "file" parameter to index.php. so i mean if "index.php?file=/folder/folder/picture.png" is set, go to file. if "file=" not set do not do anything. I get "file" parameter with $_REQUEST thingy. please help thanks.. ...

Site in maintenance. How to redirect visitors?

My PHP site in maintenance. How to redirect visitors to a "site in maintenance" single page? I heard something about app_offline.htm for ASP.NET. Is there something similar for PHP? I want that every page from "mysite.com" be redirected to "maintenance.php"; I don't want to do the minimum modification in the existing site pages, idea...

how to go to the same page after login in PHP

Hi all, For example, STEP 1: I am browsing a page without logging in and my last page before logging in is beforeLogin.php STEP 2: Now my prob is when i logged in i am redirecting to the index.php page. Instead i should be redirected to the last page what i had browsed. That is from the above example is should redirected to befor...

Redirecting a url - Wordpress

Hi, I'm working on a wordpress site, with a blog post that ends like: http://www.blog.com/?p=2. However, I need to change the wordpress settings so that posts end in the following format: http://www.blog.com/02/11/2009/this-is-a-post. When I do this, obviously it will break outside links to the post that is named http://www.blog.com/?p...

PHP Redirect location with htaccess

In one of the page I have is where administrators are allowed, however, I use if the session isn't set, the header will redirect them to index.php and that method works. If I replace index.php with home which is for the htaccess which changes it to index.php but it gives an error in the browser This works: if(!isset($_SESSION['MEMBER'...