fix(rewrite): simplify index.php content to emulate rewrite

This commit is contained in:
Jérémy Dufraisse 2023-02-27 10:52:08 +01:00
parent 0e609f7d10
commit 4c37172f60
8 changed files with 27 additions and 21 deletions

View File

@ -5,8 +5,4 @@
* Authors: see /README.md
*/
chdir(dirname(__DIR__,1));
$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1;
$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],1).'/index.php';
$_SERVER['QUERY_STRING'] = '&' . ($_SERVER['QUERY_STRING'] ?? '') ;
$_SERVER['PICO_URL_REWRITING'] = true;
include 'index.php';

View File

@ -5,8 +5,4 @@
* Authors: see /README.md
*/
chdir(dirname(__DIR__,2));
$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1;
$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],2).'/index.php';
$_SERVER['QUERY_STRING'] = 'sub&' . ($_SERVER['QUERY_STRING'] ?? '') ;
$_SERVER['PICO_URL_REWRITING'] = true;
include 'index.php';
include 'index.php';

View File

@ -5,8 +5,4 @@
* Authors: see /README.md
*/
chdir(dirname(__DIR__,3));
$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1;
$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],3).'/index.php';
$_SERVER['QUERY_STRING'] = 'page&' . ($_SERVER['QUERY_STRING'] ?? '') ;
$_SERVER['PICO_URL_REWRITING'] = true;
include 'index.php';
include 'index.php';

View File

@ -5,8 +5,4 @@
* Authors: see /README.md
*/
chdir(dirname(__DIR__,2));
$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1;
$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],2).'/index.php';
$_SERVER['QUERY_STRING'] = 'theme&' . ($_SERVER['QUERY_STRING'] ?? '') ;
$_SERVER['PICO_URL_REWRITING'] = true;
include 'index.php';

View File

@ -6,9 +6,7 @@
*/
chdir(dirname(__DIR__,2));
$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 2;
if (is_file('vendor/autoload.php')) {
if (is_file('vendor/autoload.php')) {
include_once('vendor/autoload.php');
}

View File

@ -0,0 +1,8 @@
<?php
/**
* SPDX-License-Identifier: EUPL-1.2
* Authors: see /README.md
*/
chdir(dirname(__DIR__));
include 'index.php';

View File

@ -0,0 +1,8 @@
<?php
/**
* SPDX-License-Identifier: EUPL-1.2
* Authors: see /README.md
*/
chdir(dirname(__DIR__,1));
include 'index.php';

View File

@ -0,0 +1,8 @@
<?php
/**
* SPDX-License-Identifier: EUPL-1.2
* Authors: see /README.md
*/
chdir(dirname(__DIR__));
include 'index.php';