redirect

Return 307 Temporary Redirect in ASP.NET MVC

Is it possible to return a 307 Temporary Redirect from a controller in ASP.NET MVC? I sometimes need to re-POST the values submitted from one form to another URI. Using JavaScript to do the selection on the client side (thereby bypassing this issue) is not an option. Redirecting via a GET is not an option as posted data includes an 8k...

Javascript: Redirect

Hello, I have a problem: I want to redirect via JavaScript to a directory above. My code: window.location.href = (location.href).substr(0, (location.href).lastIndexOf('folder')); The url looks like this: domain.com/path/folder/index.php?file=abc&test=123&lol=cool The redirect affect just this: domain.com/path/&test=123&lol=...

.htaccess / https redirection, virtual folder access with exceptions

/* THIS would appear to be a duplicate of another question I had asked 10 days back (http://stackoverflow.com/questions/1601876/htaccess-redirecting-to-https-www-mydomain-com-and-virtual-folder-access), but (a) I didnt get any responses to the changes I made to the question, and (b) this question here is a more complex version of the abo...

How to redirect based on Accept-Language with Apache / mod_rewrite

For language redirects we currently create folders in the web root containing an index.php file which checks the HTTP_ACCEPT_LANG server variable. e.g. for the url www.example.com/press/ in /var/www/site/press/index.php: <?php if ($_SERVER["HTTP_ACCEPT_LANGUAGE"] == "en") header("location: ../press_en.php"); else header("l...

Rails redirect with https

Hi everyone, I'm maintaining a Ruby on Rails site and I'm confused as to how to perform redirects to relative URLs using the https protocol. I can successfully create a redirect to a relative URL using http, for example: redirect_to "/some_directory/" But I cannot discern how to create a redirect to a URL using the https protocol. I...

How to use errordocument to redirect to a php file in the same folder?

I want to take requests for missing files in a specific folder and redirect them to program.php in that folder. This is a program I will use a lot in different places, and I would prefer to avoid specifying the name of the folder in the htaccess file. I have tried just putting: errordocument 404 program.php but the result is that the...

Response.Redirect to same page without Page Refresh

I need to do a response.redirect to the same page. How can I do this without the page "refreshing" or "flashing"? I can't use updatepanels because, this is a search website and I want the user to be able to use the browser's back button. I have some search filters on the page, and each time a filter is clicked, I do a resposne.redirec...

Allowing .htaccess redirects

I have a Vista machine running Apache 2.2, MySQL and PHP. I'm trying to test a WordPress site that has it's database set up in a test area on the internet. I'm able to access the home page and everything works just fine. But I want to set the Permalinks to use 'Month and name'. This works fine on the test site that is on the internet, bu...

PHP cURL: How do I make it visit this website before continuing?

I am passing post data to a website, but I have to visit the homepage first before I can navigate to any other parts of the website. So how can I do that? Do I just use a header redirect and then have it execute the rest of the cURL? Update: I think this might be better than the solution below: http://coderscult.com/php/php-curl/2008/05...

php google analytics question about redirect with 'header'

Hay All. I'm currently working on a 'checkout' system, the actual payment and stuff is done by a third party. When a user checks out using a form it sends all the GET data to some other site, lets call this 'checkout.com'. So the query string is 'checkout.com?var=1&var2=2'. What i want to do is put a page between my form and this call...

How do I redirect the input and output of a console C# program to a socket?

How do I redirect the input and output of a console C# program to a socket? I need to start the program from within another process, and make it receive input and emit output to another process running on another computer in the network. What I'm trying to do is to programmatically run an application on another station, while controlling...

Redirect site visitors during maintenance

I have a site that will be "down" for a few hours while a third party (CC processor) performs maintenance (in other words, the machine will still be online/running). I have already created a maintenance.aspx page. At first, I was going to simply add the new page as the default document in IIS (Server 2003, IIS 6.0), but this still leav...

How do I redirect to my same URL without getting a too many redirects error?

I need to redirect users from http://myurl.com/Login.action to http://myurl.com/app/Login.action I tried this but I get an error saying I get too many redirects. RedirectMatch ([A-Za-z]*)\.action$ http://myurl.com/app/$1.action How can I get apache to redirect to the same URL but only redirect once. Would something like this work? R...

Duplicate content with forwarding from TLD to different 'start page'

I came across something interesting today. See this site. Notice that the TLD automatically forwards to /about-alc/. This is because, the home section is actually called 'About ALC'. I recently used a site map generator, and it said 'Duplicate content' for the TLD and the /about-alc/ Is this not a good approach? Should I just throw a...

determining that a Postback opens a new page

I have a page (page1) with a LinkButton that, when clicked, will take the browser to a new page (page2). When I click the LinkButton page1 posts back and hits the Init and Load event handlers for page1, and then moves on to page2. How can I tell in the page1 postback that I am about to be taken to a new page, as opposed to clicking a B...

Determine if a mobile browser is CSS and javascript capable or not...

I'm designing a mobile site, and basically I want two versions. One will be javascript and css intensive, while another will be for older phones. Very simple xhtml. Any way to auto-redirect depending on the browser's capabilities? ...

Redirect stdout to an edit control (Win32)

Hello, I have a simple Win32 GUI app which has an edit control in the main window. If I write: printf("Hello world!\n"); I would like the text to appear in that control instead of the console. How to? Update: The app is just simple window with edit control and I can compile it with or without displaying the console (gcc -mwindows). ...

Getting output from one executable in an other one

Hi there. I'm currently trying to get the output of an executable console-app into an other one. To be exact, a little overview of what I'm trying to do: I have one executable which I cannot edit and neither see it's code. It writes some (quite a bunch to be honest) lines into the console when executed. Now I want to write another exe...

Proper status code for a maintenance page redirect?

While performing some upcoming maintenance, I'm going to have to redirect all site traffic to a maintenance page briefly. What's the proper status code to use for the redirect? 503 makes sense, but it's not technically a redirection status. 302 is a temp redirect, but wondering if that might have implications if the site is being spider...

Code Igniter Login, Session and Redirect Problem in Internet Explorer?

I'm still new to code igniter and I'm having problems getting the login system to work. The login always works when I use Firefox. The login consistently works on some IE7 browsers but consistently fails on other IE7 browsers. When tracing the code, I see that the models/redux_auth_model.php does successfully authenticate the use...