redirect

How do I do a Javascript Redirect in asp.net

Hi All, I have a asp.net webform with a button. The OnClientClick event is wired to a javascript function. I need this function to redirect the current page to this page. After much reading is have tried all the following, but to no avail: var url = "http://www.google.com"; document.location = url; //Doesn't Wor...

URL strategy for multilingual website

Hello! I was wondering what would be the best URL strategy for a multilingual website (for an Italy based company). I was thinking about site.com/it and site.com/en, not showing any content at site.com and redirecting the visitors to the localized site when they try to access site.com. What about buying an additional domain, site.it...

Which HTTP redirect status code is best for this REST API scenario?

I'm working on a REST API. The key objects ("nouns") are "items", and each item has a unique ID. E.g. to get info on the item with ID foo: GET http://api.example.com/v1/item/foo New items can be created, but the client doesn't get to pick the ID. Instead, the client sends some info that represents that item. So to create a new item: P...

Retain anchor when redirecting subdomain (IE)

Firefox: http://example.com/about/#anchor -> http://www.example.com/about/#anchor Internet Explorer 6-8: http://example.com/about/#anchor -> http://www.example.com/about/ Why is the anchor dropped in IE and what can I do about it? (Query string is not dropped, only the #xyz part) Is a PHP header or javascript redirect my only option? ...

How to check for redirects on ajax calls?

I was looking at this answer and some other answers http://stackoverflow.com/questions/199099/how-to-manage-a-redirect-request-after-a-jquery-ajax-call/199156#199156 I can not get this to work. i check the XMLHttpRequest object in both success and complete. In both cases when there is a redirect instead of getting a 302 i get a 200 and ...

Redirect a specific IP address to a special page of my homepage with .htaccess

How can I use .htaccess to forward a visitor of a specific IP address to a webpage on my server? This example causes an infinite loop: RewriteCond %{REMOTE_ADDR} ^123\.\123\.123\.123$ RewriteRule ^(.*)$ /specialpage.php [R,L] I found this on the web but it just does not work: SetEnvIf REMOTE_ADDR 123.123.123.123 REDIR="redir" Rewri...

Need help redirecting http://website.com/ to http://www.website.com/

What I'm trying to do is to redirect my website visitors who enter example.com to www.example.com. I would do this with a standard redirect, but I don't know how to make a site specific to WWW or non-WWW addresses. I see that Firefox thinks my site is clearly different at the WWW version, because it reloads it without using the cache. ...

Using htaccess rewrite/redirect so single PHP file can display data according to GET/POST variables

Hey gang, Bear with me as I try to learn more about .htaccess redirect rules - I'm a UI guy by profession and I'm doing my best to enhance my coding skills languages other than HTML/CSS/PHP, etc So, what I have is an index.php file that contains a menu - pretty simple. If Javascript is enabled on the users computer then forms are shown...

How do I issue an HTTP redirect with Perl's CGI.pm?

Hello, I want to perform an HTTP redirect, but the way I am currently doing it isn't working. When I try redirect it just prints the status code, and the location header: my $q = new CGI; q->redirect(" http://www.google.com "); ...

Redirection on the last Slideshow-Element with Jquery

Hi, I'm very new to Jquery and want to realize a manual slideshow with a page-redirect on the last "next"-button. I detect the last Slide-Element with CSS-Classes and then I want to add a Class to the next button to declare that it is the last next-button of the whole Slideshow. The half of my Code works :) – If I navigate to the last...

PHP - Pass POST variables with header()?

Hi, I'm trying to use the header() function to create a redirect. I would like to display an error message. Currently I'm sending the message as a parameter through the URL, however this makes it look quite ugly. Is there a way to pass this value as a post variable instead? Any advice appreciated. Thanks. ...

Any way to assign terminal output to variable with python?

I need to grab the duration of a video file via python as part of a larger script. I know I can use ffmpeg to grab the duration, but I need to be able to save that output as a variable back in python. I thought this would work, but it's giving me a value of 0: cmd = 'ffmpeg -i %s 2>&1 | grep "Duration" | cut -d \' \' -f 4 | sed s/,//' %...

Redirect to a specific url depending upon the base url using htaccess file

I am using htaccess to redirect to url with page description. For example RewriteRule ^Flash$ /index.php?section=flash [L,NC] By using this code when i hot domain.com/Flash it redirects me to www.domain.com/index.php? section=flash. This works fine. But now what i want to have two more site with the same htaccess file. So can an...

Possible to have ampersands ("&") in URL BEFORE the query string?

My client is determined to have a page at /nfm&t so I made a directory named nfm&t with an index.html (to test) and that URL is still throwing a 404. So apparently it's not that easy. Any ideas? Or is there a way to just redirect nfm&t to nfmt, so that the URL at least resolves? This is a Windows server, by the way, which throws a wren...

How to remove the upper right close button

I need to kill the close 'x' button at the top of a jQuery UI modal dialog box. I have a modal that opens with an OK button that redirects to the site. The site behind the modal is in an iframe. When the user agrees to the statement in the dialog box and clicks the 'OK' button, it redirects to the site that is outside the iframe. If the ...

django: search forms and redirect

After processing form from POST I should redirect, to prevent user from hitting back. However, I am using form to determine search query on a database, so I need to either pass params to the redirected site or the result of a search. Or maybe there is some other good practice, how to solve this problem? Maybe in this situation I am allow...

Non-SEO anti-spoofing external link redirect: Status code?

I've read several documents on the merits of the different HTTP redirect status codes, but those've all been very SEO-centric. I've now got a problem where search-engines don't factor in, because the section of the site in question is not publicly viewable. However, we do want our website to be as accurate / helpful with meta-data as po...

set up way of getting mysite.$domain

Hi I have several domains, only one website and one databse table for each domain. example: wbesite.us - data from USA goes to database table main_usa wbesite.co.uk - data form UK goes to database table main_uk Only have one database with name of the website. Having only one website structured, and having variables like $sql="select...

aspnet membeship logon page and https redirect

Hello, I have a gridview control that has on onclick event bound to every cell. Once a user clicks on a cell it directs them to a booking confirmation page and passes 3 url variables. This booking page is behind a aspnet membership and thus if the user is not logged in they are served the login page. The login page has a redirect to htt...

How do I redirect to the current page in php?

How do I use the header redirect to make it redirect to the current page? EDIT: I am trying to make it reload the currently shown page in the browser. ...