fix(Rewrite): first step to emulate it

feat/use-default-theme
dufraissejeremy 2 years ago
parent 1428bc882f
commit ab24951341
  1. 1
      content/config.yml
  2. 12
      content/index.php
  3. 12
      content/sub/index.php
  4. 12
      content/sub/page/index.php
  5. 12
      content/theme/index.php
  6. 1
      sites/default/index.php

@ -5,7 +5,6 @@
site_title: Pico # The title of your website
base_url: ~ # Pico will try to guess its base URL, if this fails, override it here;
# 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
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

@ -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';

@ -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';

@ -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';

@ -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';

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

Loading…
Cancel
Save