Aggiunto redirect in caso di public raggiungibile
This commit is contained in:
parent
d9ac17d1b2
commit
c50a381626
|
@ -0,0 +1,4 @@
|
|||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteRule ^.+$ index.php [L]
|
||||
</IfModule>
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
$base_dir = __DIR__;
|
||||
|
||||
// Individuazione di $prefix
|
||||
$script = $_SERVER['REQUEST_URI'];
|
||||
$needle = '/'.basename($base_dir).'/';
|
||||
$pos = strrpos($script, $needle);
|
||||
if ($pos !== false) {
|
||||
$prefix = substr($script, 0, $pos).$needle;
|
||||
$suffix = substr($script, $pos + strlen($needle));
|
||||
} else {
|
||||
$prefix = '/';
|
||||
$suffix = '';
|
||||
}
|
||||
$prefix = rtrim($prefix, '/');
|
||||
$prefix = str_replace('%2F', '/', rawurlencode($prefix));
|
||||
$suffix = str_replace('%2F', '/', rawurlencode($suffix));
|
||||
|
||||
$url = 'http://'.$_SERVER['HTTP_HOST'].$prefix.'/public/'.$suffix;
|
||||
$url = str_replace('index.php', '', $url);
|
||||
|
||||
header('Location: '.$url);
|
||||
exit();
|
2
legacy
2
legacy
|
@ -1 +1 @@
|
|||
Subproject commit 39a79aea88f220f4d49c349df176b1ef310005f8
|
||||
Subproject commit af0668f0c2e9751c36430e1b7595a1d32058ef64
|
Loading…
Reference in New Issue