301 redirect with PHP
header('HTTP/1.0 301 Moved Permanently'); header('Location: http://new-page.com/'); header('Connection: close'); exit();
12364 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
header('HTTP/1.0 301 Moved Permanently'); header('Location: http://new-page.com/'); header('Connection: close'); exit();
<?php header ('HTTP/1.1 301 Moved Permanently'); header('Location: http://domain.com/'); exit; ?>
find views -name [a-z]\*rhtml | xargs -n1 grep -H "@page_title" | grep -v "<%" | sed "s/\@page_title = //" | sed "s/rhtml/png/" | sed "s:views/::" | sed "s:/:_:g" | sed "s:^:public/images/beta/headers/hdr_:" | sed "s/ //g"
< ?php
// request like this http://<domain>/tinyurl.php?c=<tinyurl>
$num = $_GET['c'];
if($fp = fsockopen ("tinyurl.com", 80, $errno, $errstr, 30))
{
if ($fp) {
fputs ($fp, "HEAD /$num HTTP/1.0\r\nHost: tinyurl.com\r\n\r\n");
while (!feof($fp)) {$headers .= fgets ($fp,128);}
fclose ($fp);
}
$arr1=explode("Location:",$headers);
$arr=explode("\n",trim($arr1[1]));
echo trim($arr[0]);
}
?>
- (void)_drawThemeContents:(NSRect)cellFrame highlighted:(BOOL)highlighted inView:(NSTableHeaderView *)view; { int index = [view columnAtPoint:NSMakePoint(cellFrame.origin.x + 1,cellFrame.origin.y + 1)]; NSRect headerRect; if(index != -1) headerRect = [view headerRectOfColumn:index]; else headerRect = NSZeroRect; [headerImage drawInRect:cellFrame fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; [[NSColor colorWithCalibratedRed:207.0/255.0 green:207.0/255.0 blue:207.0/255.0 alpha:1.0] set]; NSRectFill(NSMakeRect(headerRect.origin.x, headerRect.origin.y + 1, headerRect.size.width, headerRect.size.height - 2)); [headerImage drawInRect:NSMakeRect(headerRect.origin.x, headerRect.origin.y, headerRect.size.width - 1, headerRect.size.height) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; }
require 'csv' csv_data = CSV.read 'data.csv' headers = csv_data.shift.map {|i| i.to_s } string_data = csv_data.map {|row| row.map {|cell| cell.to_s } } array_of_hashes = string_data.map {|row| Hash[*headers.zip(row).flatten] }
<?php ob_start(); header("Location: somepage.php"); //Redirect ob_end_flush(); exit; ?>