예제 #1
0
<?php

createHtaccess();

$baseURL = dirname($_SERVER['SCRIPT_NAME']);
if($baseURL == "/") {
	$baseURL = "";
}

if(isset($_REQUEST['force'])) {
	echo "Forced continue, attempting to redirect to <a href=\"home/successfullyinstalled?flush=1\">home/successfullyinstalled</a>.
		<script>setTimeout(function() { window.location.href = 'home/successfullyinstalled?flush=1'; }, 1000);</script>";
} else {	
	$modRewriteWorking  = performModRewriteTest();
	
	if(!$modRewriteWorking) {
		createHtaccessAlternative();
		$modRewriteWorking  = performModRewriteTest();
	}
	
	if($modRewriteWorking) {
		echo "mod_rewrite is working! I will now try and direct you to
					<a href=\"home/successfullyinstalled?flush=1\">home/successfullyinstalled</a> to confirm that the installation was successful.
					<script>setTimeout(function() { window.location.href = 'home/successfullyinstalled?flush=1'; }, 1000);</script>
		";
	} else {
		restoreHtaccess();
		
		echo "mod_rewrite doesn't appear to be working. Make sure:" .
				"<ul>" .
				"<li>mod_rewrite is enabled in your httpd.conf</li>" .
예제 #2
0
파일: index.php 프로젝트: phn007/MyTools
<?php

ini_set('display_errors', 1);
//error_reporting(~0);
date_default_timezone_set("Asia/Bangkok");
$root = dirname(realpath(__FILE__)) . '/';
$appPath = $root . $appDir . '/';
$protectFilePath = $appPath . '.htaccess';
if (!file_exists($protectFilePath)) {
    include $appPath . 'protectFile.php';
    createHtaccess($appPath);
    createHtpasswd($appPath);
}
include $appPath . 'libs/initvars.php';
if (isset($_GET['ping'])) {
    include $appPath . 'ping.php';
}
include THEME_PATH . '_config/define-site-config.php';
include THEME_PATH . '_config/link_trait.php';
include $appPath . 'libs/core.php';