redirect

Clean up redirect rules/rewrite rules at the cost of SEO?

I'm about to work on a retail product website that has been around for about 10 years. The website ranks nicely in Google search results. The website has evolved a lot over the years so it's no surprise their .htaccess file is full of 301 redirects and rewriterules. There are so many rules it's an eye sore. Sometimes there are thre...

How to Restrict a SAML 302 Redirect to an IFRAME?

Is it possible to load content within an IFRAME that subsequently returns a 302 redirect, without having it redirect the entire browser window to the destination? I.e. limit the redirect to the IFRAME itself? If so, how? EDIT1: To restate... i have an IFRAME, the source of which is a self-posting FORM. The action returns a 302 to somewh...

xmlhttprequest to spoof referer then redirect to another page?

Hello, I've created some code using curl (PHP) which allows me to spoof the referrer or blank the referer then direct the user to another page with an spoofed referrer. However the drawback to this is the IP address in the headers will always be the IP of my server, which isn't a valid solution. The question; Is it possible using cl...

RedirectResult not working with jQuery.post()

Hi Guys I'm trying to do an asynchronous login. When the user is authenticated I want to redirect to the user's originally requested page. The problem is that the Action Method is returning a Redirect type of ActionResult and the jQuery doesn't seem to know what to do.. I'm using the following jQuery: $("form").submit(function(event) ...

Problem reading the XMLHttpRequest.status when redirecting

I am requesting something with $.ajax and i am getting a 302 or 200 status after the call. I want to insert something into the DOM when status is 200 and make the actual redirect when the status returned is 302. For that I am using: (took that snippet from a diffrent thread here) complete: function (XMLHttpRequest, textStatus) { al...

PHP Redirect by Browser Language not working!

I change languages using php arrays which makes the URL look like this: http://alexchen.zxq.net/index.php?lang=es I added $lang=$_SERVER['HTTP_ACCEPT_LANGUAGE']; in my 'controller' file in default sections, and I choose another language in the preferred languages option (Mozilla Firefox), but it didn't work. common.php: <?php sessio...

Looping Redirect with PyFacebook and Google App Engine

I have a Python Facebook project hosted on Google App Engine and use the following code to handle initialization of the Facebook API using PyFacebook. # Facebook Initialization def initialize_facebook(f): # Redirection handler def redirect(self, url): logger.info('Redirecting the user to: ' + url) self.response....

Redirect with a variable

I re-did my portfolio site recently, and I'm trying to make it so that when someone clicks a link to my and old project (ie /philosophy.php) that it takes the name of that file (philosophy) and then adds it to an id indicator # and loads to my new page with that ID selected so it automatically scrolls to that project. Click link > http...

link back to full page from a mobile version

I would like to forward iphone users to a mobile version of my site with apache's RewriteCond %{HTTP_USER_AGENT} (...) My question is, how would I redirect visitors of the mobile site back to the full site? Since they're on a mobile device, they'd just get re-routed to the mobile site again right? Cheers, Phil ...

How do I get the URL of an HTTP redirect's target?

I am writing client-side Python unit tests to verify whether the HTTP 302 redirects on my Google App Engine site are pointing to the right pages. So far, I have been calling urllib2.urlopen(my_url).geturl(). However, I have encountered 2 issues: the URL returned by geturl() does not appear to include URL query strings like ?k1=v1&k2=v2...

unexpected '{' in header.php on line 1 of WordPress

I am using following code to redirect users based on browser language: if(!isset($_SESSION['lang'])){ if(preg_match('/en-US/', $_SERVER['HTTP_USER_AGENT'])){ $_SESSION['lang'] = 'en'; header("location:index.php"); }else{ $_SESSION['lang'] = 'other'; header("location:http://cn.gearor.com"); } } I put the code in my...

Why is header() causing an internal server error?

I cannot figure out what could be causing this error. My Apache log is not recording any errors in the access log or error log regarding the page, yet somehow whenever I uncomment the header() line I get a 500 Internal Server Error. It can't be coming from PHP's fatal error when content is outputted before header() is called, that wouldn...

Using JQuery to redirect to a third party page and prefill form values.

When clicked on a link on my web page, I want to redirect to third party web page (like google) and prefill the search window with my query and simulate clicks. Is it possible to do with just jquery? ...

RedirectToRoute("Default") and Redirect(returnUrl) are returning '200' instead of '302'

Hi Guys I'm trying to use the following code to log users in: $("form").submit(function(event) { $.ajax({ type: "POST", url: $(this).attr("action"), data: $(this).serialize(), complete: function(XMLHttpRequest, textStatus) { if (XMLHttpRequest.status === 302) { ...

Redirect in Front Controller plugin Zend

Hi, I'm trying to centralise my redirects (based on authentication and various other states) into a front controller plugin. So far I've tried: $this->setRequest(new Zend_Controller_Request_Http('my_url')); at various points in the plugin (i.e. from routeStartup to dispatchLoopShutdown) and also: $this->setResponse(new Zend_C...

Redirect users from other websites based on browser language

I want to do this: if (user from other website, like google, or input our website URL directly in the browser) { //redirect according to browser languge if (!preg_match('/en-US/', $_SERVER['HTTP_USER_AGENT'])) { wp_redirect("http://cn.gearor.com"); } } I don't know how to write the first if statement, I don...

Handling response.redirect errors in JSP page

Hi i have a condition where an URL is manipulated or changed wantedly. i have to catch the error and move to error page. but the error page is never called. I am using response.sendRedirect("MyURL"); in the jsp page. If the URL is correct its working fine. If i manipulate the URL and use the command it shows HTTP 404 error in the s...

redirecting 404 error with .htaccess

Hi, I couldn't find a straight answer to my question and need to know it from the real experts. I had a website which urls were generated by Joomla. I believe that tons of urls are around in the search engines and I really don't know which of them all. A 302 redirect would be an option, but I can't say which urls need to be redirected....

How to write a global redirect in C#?

A client has sent out an email with a link containging a typo for a website we run [E.g. http://example.com/?id=123.]. What is the best way to re-direct anyone who visits the bad URL? If someone clicks on the link, can we catch it in the Global.asax, checking if the path ends with "." then removing it and re-directing? If so, where in G...

FireFox 3.6 for Mac not reading cookie / redirecting properly

Hello, I have a nifty little cookie-based home page redirection scheme going for my website. Basically, the first time a user browses to the website, they are presented with two choices (Products vs. Machining Services). When the user clicks one of the two buttons, a JavaScript function stores a cookie with the appropriate choice ("pr...