redirect

Maintain HTTP Referer

Hey, I've setup some redirects on an Apache server. They look at bit like this: Redirect /Name/register /login.html My question is this... is there anyway to preserve the HTTP Referrer through this redirect? It would seem that by default, Apache discards the information. I would really like it if after the redirect was complete the re...

Most Correct way to redirect page with Model-View-Presenter Pattern

What is the best way to call a Response.Redirect in the Model-View-Presenter pattern while adhering to correct tier separation? ...

Asp.NET MVC Redirect not working

The following examples are redirects wich we're trying. The first one, for user login, works, after that no redirect works. I have no idea about what may be the cause, tried redirecttoroute too, it is like if the server wasn't sending the headers or anything. I have no sniffing software to check this out. UrlHelper uH = new UrlHelper(ne...

WWW to non-WWW Redirect with PHP

I want to redirect all www.domain.com requests to domain.com with PHP, basically: if (substr($_SERVER['SERVER_NAME'], 0, 4) === 'www.') { header('Location: http://' . substr($_SERVER['SERVER_NAME'], 4)); exit(); } However I do want to maintain the requested URL like in SO, for e.g.: http://www.stackoverflow.com/questions/tagged/p...

How to keep URL display unchanged after redirecting root folder to sub folder

I want to redirect all queries to mydomain.com to mydomain.com/live/. I'm already able to do that, however I have trouble with the URL displayed in the browser. I have two goals, (1) that the URL always renders with "www" in front and (2) that the sub folder "live" is not displayed in the url. EDIT: Based on edited code by Cryo the fo...

How to track a download page with google-analytics and php?

Hi, I have a download page in php that after performing some checks returns a file, without displaying any html: header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=xyz.exe'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); ...

CodeIgniter form submit redirects to localhost

I have a CodeIgniter project with a very simple test application. Controller opens a view (PHP page) which has a text box and a submit button. When I press the submit button, instead of redirecting to the appropriate function call in the controller, I get redirected to localhost/xampp. here's the code on my view, which SHOULD be redire...

ISAPI Rewrite rule help ( .html -> .aspx )

Hello, Recently I'm working on a refactor project from asp to asp.net 3.5. There are lots of .html file uses .inc file for the header and footer in the old site, and needed to be converted to .aspx uses master page. My problem is, for search engine and for bookmark those old pages are all gone Therefore I need to redirect the old .html...

How do I detect when output is being redirected?

I have a Win32 application written in C that can have its console output via printf() redirected to a log file. It would be nice if I could have my app. detect if it had been started with or without a redirect '>'. Any ideas? ...

trying to redirect to external site with php

I'm trying to redirect mobile users and am attempting the following, but it doesn't actually redirect at all... $ua = strtolower($_SERVER['HTTP_USER_AGENT']); //print $ua; $search = array('windows ce', 'avantgo', 'mazingo', 'mobile', 'iphone', 't68', 'syncalot', 'blazer'); foreach($search as $sk => $sv) { if(preg_match('/\b'.$sv....

Redirecting if statement not working

Hey, I am trying to make an if statement that redirects them to a different page if true, simple right? I am not sure why this is not working but I am using: if ($_POST['accounttype']=='Paid User - £2 p/m'){ $userid = strtolower($_SESSION['X2X2']); $getuser = mysql_query("SELECT * FROM XXXXXX WHERE X2X2 = '$userid'"); $info...

Redirecting to a Web Page from a Web Service call

I have a .net web service that takes some xml data. From within the web service, I want to manipulate the data and then call a web page that displays information to the user. The web service should return after spaning the web page. I am not having any luck doing this. I have tried Server.Transfer(url, end); Which generates th...

IIS7 Url Rewrite - Redirect from {any}.aspx to {any}

I am converting my website from Asp.Net Webforms to Asp.Net MVC. I want to redirect all my old .aspx files to drop the .aspx. I run IIS7 with the Url Rewrite module installed. Example: /about.aspx -> /about The user will go to http://www.site.com/about.aspx and I want them redirected to http://www.site.com/about. How do I do this u...

Update Href of Link button Through Jquery.

I am using a link button to redirect the page to my desired location with some query string value from Jquery. The Link Button code are as follows: <td> <a id="selectAllLink" class="button" rel="nofollow ibox&width=800&height=400&title=Contact Now" href="#" onclick="return (this.href=='#');">Contact Selected<...

Redirecting screen output from cell phone to monitor screen

Is there any way to redirect cell phone output to a standard screen? Would it be possible on Linux & X-server based devices - like Maemo? And on Android devices? ...

Check condition and automatically redirect to a link, html

I'm creating a sample website using xhtml with javascript support. Also using php for server side programming. I need to redirect the webpage to some other page from an html page, after checking some condition.What is the best method to implement this. I've done it using header("link"); but since i'm using it inside the tag, it shows u...

php header not redirecting when using forms

Hi, Seem to have a unique problem. I'm doing form validation using a php script. I initially wrote this code in 2007. All of a sudden it stopped working, and I've been trying to figure out why. Here's the code: <?php $error_msg = ''; // Only Validate Form when it is submitted if (isset($formSubmit)) { if (!isset($_SESSION["Firs...

Htaccess redirect not working?

Hi! I am trying to use an htaccess redirect, and for some reason when I try to redirect the user, instead of going to page.html, it tries to go to page.htmlpage.htmlpage.htmlpage.html and it just keeps on repeating it. Anyone have any clue what I am going wrong? Here is my htaccess file: IndexIgnore .htaccess */.??* *~ *# */HEADER* */...

How to avoid a redirect loop in ASP.NET MVC

In certain error conditions I would like to redirect to the Home controller but I want to make sure that I don't get into a "redirect" loop (with an exception being generated each time resulting in yet another redirect). What is the best way to do this? ...

PHP - header("Location:") inside a function redirects without calling function

I'm using a function called headerLocation() in order to redirect properly. This is the pertinent part of the function, I'm using it to redirect and then display an appropriate message (personal preference). function headerLocation($location,$message) { $_SESSION['output'] = $message; header("Location: ". $location); } The pro...