fix(Rewrite): first step to emulate it

This commit is contained in:
Jérémy Dufraisse 2023-02-26 02:08:50 +01:00
parent 1428bc882f
commit ab24951341
6 changed files with 49 additions and 1 deletions

View File

@ -5,7 +5,6 @@
site_title: Pico # The title of your website site_title: Pico # The title of your website
base_url: ~ # Pico will try to guess its base URL, if this fails, override it here; base_url: ~ # Pico will try to guess its base URL, if this fails, override it here;
# Example: https://example.com/pico/ # Example: https://example.com/pico/
rewrite_url: false # A boolean (true or false) indicating whether URL rewriting is forced
debug: ~ # Set this to true to enable Pico's debug mode debug: ~ # Set this to true to enable Pico's debug mode
timezone: ~ # Your PHP installation might require you to manually specify a timezone timezone: ~ # Your PHP installation might require you to manually specify a timezone
locale: ~ # Your PHP installation might require you to manually specify a locale to use locale: ~ # Your PHP installation might require you to manually specify a locale to use

12
content/index.php Normal file
View File

@ -0,0 +1,12 @@
<?php
/**
* SPDX-License-Identifier: EUPL-1.2
* 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';

12
content/sub/index.php Normal file
View File

@ -0,0 +1,12 @@
<?php
/**
* SPDX-License-Identifier: EUPL-1.2
* 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';

View File

@ -0,0 +1,12 @@
<?php
/**
* SPDX-License-Identifier: EUPL-1.2
* 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';

12
content/theme/index.php Normal file
View File

@ -0,0 +1,12 @@
<?php
/**
* SPDX-License-Identifier: EUPL-1.2
* 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,6 +6,7 @@
*/ */
chdir(dirname(__DIR__,2)); chdir(dirname(__DIR__,2));
$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 2;
if (is_file('vendor/autoload.php')) { if (is_file('vendor/autoload.php')) {
include_once('vendor/autoload.php'); include_once('vendor/autoload.php');