Blame view

redirect/redirect.php 463 Bytes
42868d70   andryeyev   Создал GIT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  <?php
  //require_once($_SERVER['DOCUMENT_ROOT'] . '/libs/FGetCSV.php');
  
  if($_GET['t']==1){
  print_r($_SERVER);
  }
  
  $URL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
  
  $f = fopen($_SERVER['DOCUMENT_ROOT'] . "/redirect/redirect.csv", "r") or die("Ошибка!");
  for ($i=0; $row_line=File_FGetCSV::fgetcsv($f,1500,";"); $i++) {
  	if($URL == $row_line[0]){
  	  header("HTTP/1.1 301 Moved Permanently");
  	  header('location:'.$row_line[1]);exit;
  	}
  }
  ?>