Redirect Response Snippets


You should use err_headers_out() and not headers_out() when you want to send cookies in the REDIRECT response.

11 May, 2013   

ASP code example using a 301 redirect

20 March, 2013   

ASP code example for Moved Permanently 301 Redirect

29 December, 2011   

ASP code example to redirect the user to a different URL.

23 September, 2011   

An example Dates with the Ordinal Suffix . Below is the code that will do this.

This example has an ordinal suffix: Sunday 15th July

26 February, 2011   

This redirects visitors to a new URL using a 301 redirect. Using a 301 redirect is the safest way to let search engines like Google, Yahoo!, Live and Ask know your address has changed.

16 June, 2012   

You can use JavaScript window.location to redirect a visitor to a required page. You may have seen this feature used by sites with full page ads, or to redirect visitors to the site's new domain name. You can add also a timer to the script that will allow the page to redirect and the visitors will not need to click a link or type in the new URL.

30 April, 2011   

This allows you to redirect the page using meta tag. Setting content to 0 for immediate redirect.

08 June, 2011   

Did you know that search engine crawlers think that 'www.yoursite.com' and 'yoursite.com' are two different websites!? We need to help the crawlers out and tell them that the two URLs are the same. We can do this with a 301 (moved permanently) redirect. The code below will redirect requests for 'yoursite.com' to 'www.yoursite.com .

24 October, 2016   

You should NOT use this if you are ACTUALLY using WordPress.

16 February, 2012   

ASP code to ban user based on their IP address

27 April, 2014   

Code example for tracking email response

The JavaScript is just a function called redirect, and is requesting that a variable be passed to it.

Scripts used to calculate Daylight Saving Time (DST) for the US and EU. Valid for years 1900 to 2099. [DST wasn't adopted until the 1950s-1960s for US and 1990s for the EU] By: brad degrandis

20 March, 2013   

ASP code example to block Multiple IP Addresses

14 March, 2012   

To find the solutions to the 8 queens puzzle. The puzzle asks "How can you place 8 Queens on a chess board so that no Queen can attack any other queen?" By: Richard Lindsay

Open up a text editor, copy & paste the code below. Save the file as: "commandlinefu.py" and exit the editor.

Run the script to test whether you have the XMLHTTP Request object installed that comes with any version of the Microsoft XML Parser (MSXML).

Run the script to test whether you have the XMLHTTP Request object installed that comes with any version of the Microsoft XML Parser (MSXML).