Differences From Artifact [86bc185097]:

To Artifact [6caf9a968a]:


42
43
44
45
46
47
48

49
50


51
52
53
54
55

56
57
58



59






60



61
62











63

		$headers = get_headers(WWW_URL);

		if (!preg_match('!^HTTP/[0-9.]+ 302!', $headers[0]))
		{
			unlink(__DIR__ . '/.htaccess');
		}


		header('Location: '.WWW_URL);


	}
	else
	{
		file_put_contents(GARRADIN_ROOT . '/config.local.php', '<?php define(\'WWW_URI\', \''.$uri.'\'); ?>');
		header('Location: '.$url);

	}
}
else



{






	header('Location: '.WWW_URL);



}












?>







>
|
|
>
>





>


|
>
>
>
|
>
>
>
>
>
>
|
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

		$headers = get_headers(WWW_URL);

		if (!preg_match('!^HTTP/[0-9.]+ 302!', $headers[0]))
		{
			unlink(__DIR__ . '/.htaccess');
		}
		else
		{
			header('Location: '.WWW_URL);
			exit;
		}
	}
	else
	{
		file_put_contents(GARRADIN_ROOT . '/config.local.php', '<?php define(\'WWW_URI\', \''.$uri.'\'); ?>');
		header('Location: '.$url);
		exit;
	}
}

// Si serveur non Apache, ou ni RewriteRule ni RedirectMatch ne fonctionnent,
// on empêche quand même de lister les répertoires
$dir = dir(GARRADIN_ROOT);

while ($file = $dir->read())
{
	if ($file[0] == '.')
	{
		continue;
	}

	if (!is_dir(GARRADIN_ROOT . '/' . $file))
	{
		continue;
	}

	file_put_contents(GARRADIN_ROOT . '/' . $file . '/index.html',
		'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' .
		'<html><head><title>404 Not Found</title></head><body>' .
		'<h1>Not Found</h1><p>The requested URL was not found on this server.</p>' .
		'</body></html>');
}

$dir->close();

header('Location: '.WWW_URL);

?>