redirect

Different Drupal front page from different country.

Hi, I have a drupal site, and i want to redirecting visitors to a different page based on the country. I have this code: require_once "Net/GeoIP.php"; $geoip = Net_GeoIP::getInstance("Net/GeoIP.dat"); try { $geocode = $geoip->lookupCountryCode($_SERVER['REMOTE_ADDR']); } catch (Exception $e) { $geocode = 'EN'; } switch ($geocode...

PHP redirect based on HTTP_HOST/SERVER_NAME within same domain

I am trying to redirect to a specific path based on HTTP_HOST or SERVER_NAME with a PHP-script. I have tried these scripts: 1. $domain = $_SERVER["SERVER_NAME"]; if (($domain == "example.dk") || ($domain == "www.example.dk")) { header("location: /index.php/da/forside"); } ?> 2. switch ($host) { case 'exam...

how do python capture 302 redirect url

i try to fetch data from web,but the page use a 302 redirect how can i use python to fetch the real url? ...

Multiple fullstops in regex for RewriteRule

I use the following rule to redirect pretty urls from http://hostname.co.za/geoip/123.12.123.34 to http://hostname.co.za/geoip/index.py?ip=123.12.123.34 .htaccess in /geoip RewriteEngine on RewriteRule ^(.*\..*\..*\..*)$ /geoip/index.py?ip=$1 This works fine to match only ip's, but when I try this, it gives a 500 server error: Rewri...

Opera and redirect issues

Has anyone seen or heard of Opera having redirect issues? I have a PHP script that POSTs back to itself, sets up some variables and then redirects to another page. This fails on a Linux box but works with no issues on Windows. EDIT: I also need to mention that redirect works well and as expected in Chrome, FF and IE. Redirect works in ...

How can I redirect my wb site visitors to an m.mydomain.com version when started from a mobile phone ?

How can I (or would you) redirect visitors visiting your web pages when they are viewing your site from a mobile phone ? I want to set up a site with the (standard?) m. prefix. Idially I would my visitors to be redirected to these pages when they visit my site using a mobile phone ? I am using Windows IIS6 and IIS7. ...

Masking the URL for one specific page

I haven't implemented this feature before myself, so sorry if I'm a bit vague on details. I know that there are 2 ways to redirect a website site1.com to a second website site2.com. If I recall correctly, in one way, the URL changes to site2.com so the user knows he's being redirected. The second way is to still show the user the origi...

Bash, stdout redirect of commands like scp

Hi, I have a bash script with some scp commands inside. It works very well but, if I try to redirect my stdout with "./myscript.sh >log", only my explicit echos are shown in the "log" file. The scp output is missing. if $C_SFTP; then scp -r $C_SFTP_USER@$C_SFTP_HOST:$C_SOURCE "$C_TMPDIR" fi Ok, what should I do now? Thank you ...

How do I redirect https:// requests to http:// in NGINX?

Is there a way to redirect https:// requests to http:// by adding a rule in the domain's vhost file? I'm using NGINX. ...

How do I get WWW::Mechanize to properly handle 302 redirects with URI fragments?

I have a webpage which redirects to another url in the form of http://www.example.com/url.html#midpage. I'm wondering if there's anyway for WWW::Mechanize to follow http://www.example.com/url.html instead of http://www.example.com/url.html#midpage? ...

Spring MVC - JSTL - Session Attribute

Hi: I have a Spring Controller where I am setting a session object with variables . @RequestMapping("/index.html") public String indexHandler(HttpSession session, HttpServletRequest request, HttpServletResponse response){ session ...

How to request data from different php page without a redirect that works with Ajax?

So I have this one CakePHP web application that I'm trying to refactor. There is a large portion of code that usually works like this: E.g. "Flag": User clicks flag button Redirect the user to the flag action Flag action flags post Redirect user to post that was just flagged. I am also trying to enhance it with JavaScript like so: Use...

dns cname redirect url

Hi all, I have two domain names: example1.com example2.com on example1.com i run an webserver in a shared environment on the internet. examle2.com is only a registered domain where i can only manage DNS. examaple1.com points to ip address: 123.123.123.123. the problem is, when i go to: http://123.123.123.123 i do not come on example1....

Apache Redirect multiple domains to other directory

I have 1 IP number 83.87.163.224 and I have 4 multiple domainnames: www.alurelingerie.nl - www.aaamsterdam.info - www.webshopdesigners.nl - www.rtps.eu Every domeinname must redirect to a sub dir on my Apache server. I tried to work with VirtualHost *:80 but I doesn't work... It doens't redirect to the correct subdir... It did only redi...

Session data lost between pages PHP?

I am making a news add form using post method. In the second page i make data validation. I define the variables like $message = $_POST["message"] and after that $_SESSION['message'] = "$message"; after that I echo the session var and everything look fine the data appear. And when I click to send which go to another page to add the data ...

rewrite and redirect

hi i just applied a new url structure to my site the links were like this before using rewrite mod /detail.php?id=123 and after /restaurant123.htm but the problem is /detail.php?id=123 still work and i've spent a week to do something to redirect /detail.php?id=123 to /restaurant123.htm without an infinite loop and i searched all over th...

rails update redirecting to wrong controller

I have a model for a task which has a name, description, the process it belongs to, the position and a category. As there are only two different categories I have created additional controllers specific to the categories as they need to be treated differently. when i submit the edit form in one of the category controllers it is redirect...

Redirect to a URL and then run a function in the context of that newly loaded page when "DOM Ready"

Is there some way for me do something like the following in Javascript? ( Specifacly I want to do this from Javascript running in an Iphone OS UIWebView) create a function called RedirectAndExecuteFunctionOnDomReady(url, function) Redirect to the HTML of the provided url When the new HTML DOM is ready, execute the provided function (w...

How many NGinx redirects is too many?

I'm working on a news centric website thats been around for years and is steadily accruing more and more page redirects. Currently we have around 375 redirects and are adding about 5-10 a month. I know that NGinx is very, very fast at handling redirects, but presumably there must be some number of redirects that will affect performan...

How to redirect to another jsp page in php

Hello, I have 1 php page that is doing some manipulation and store data in 2 variable, now I want to pass this data to another page and that page is in jsp. I dont want to click anywhere, mean my php will call automatically to jsp page in last. Please tell me how can i do this. Thanks, Manoj Singhal ...